Skip to content

Commit

Permalink
ci: add test workflow (#89)
Browse files Browse the repository at this point in the history
* ci: add test workflow

* empty commit

* ci: change cache strategy

* empty commit

* ci: use npm install

* empty commit

* ci: use npm ci
  • Loading branch information
tyankatsu0105 authored Aug 22, 2021
1 parent 8ab3d89 commit 2f05f14
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 9 deletions.
12 changes: 3 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,15 @@ jobs:
ref: main
fetch-depth: 0

- uses: actions/cache@v2
id: cache
with:
path: node_modules
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-npm-
- name: Use Node.js 12
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
cache: 'npm'
cache-dependency-path: package-lock.json
registry-url: "https://registry.npmjs.org"
node-version: "12.x"

- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci

- run: npx shipjs trigger
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Test

on: push

jobs:
test:
runs-on: ubuntu-latest

strategy:
matrix:
# Follow package.json engine field
node-version: [12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
cache: 'npm'
cache-dependency-path: package-lock.json
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test
28 changes: 28 additions & 0 deletions .github/workflows/type-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Type check

on: push

jobs:
type-check:
runs-on: ubuntu-latest

strategy:
matrix:
# Follow package.json engine field
node-version: [12.x, 13.x, 14.x]

steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
cache: 'npm'
cache-dependency-path: package-lock.json
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Typecheck
run: npm run typecheck

0 comments on commit 2f05f14

Please sign in to comment.