Skip to content

Commit 2c6fa03

Browse files
committed
Factor out a common action for setting up the test environment in Github Actions
1 parent 3a97c41 commit 2c6fa03

File tree

3 files changed

+17
-20
lines changed

3 files changed

+17
-20
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: 'Setup test environment'
2+
description: ''
3+
inputs: {}
4+
outputs: {}
5+
runs:
6+
using: "composite"
7+
steps:
8+
- name: Use Node.js ${{ matrix.node-version }}
9+
uses: actions/setup-node@v2
10+
with:
11+
node-version: ${{ matrix.node-version }}
12+
cache: 'yarn'
13+
- run: yarn install --frozen-lockfile
14+
shell: "bash"

.github/workflows/ci.yml

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,29 +12,12 @@ jobs:
1212
os: [ubuntu-latest]
1313

1414
steps:
15-
- uses: actions/checkout@v1
16-
17-
- name: Use Node.js
18-
uses: actions/setup-node@v1
19-
with:
20-
node-version: ${{ matrix.node-version }}
21-
22-
- uses: actions/cache@v2
23-
with:
24-
path: ~/.npm
25-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
26-
restore-keys: |
27-
${{ runner.os }}-node-
28-
29-
- name: Install
30-
run: yarn install --frozen-lockfile
31-
15+
- uses: actions/checkout@v2
16+
- uses: ./.github/actions/setup-test-env
3217
- name: Build JS
3318
run: yarn build
34-
3519
- name: Run Tests
3620
run: yarn run test
37-
3821
- name: Run Lint
3922
run: yarn run lint
4023

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
needs: test
1515
runs-on: ubuntu-latest
1616
steps:
17-
- uses: actions/checkout@v2.3.4
17+
- uses: actions/checkout@v2
1818
- uses: ./.github/actions/setup-test-env
1919
- name: Build all packages
2020
shell: nix develop -c bash -eo pipefail -l {0}

0 commit comments

Comments
 (0)