Skip to content

Commit 4f62e93

Browse files
authored
chore: add GH Actions CI (#9101)
1 parent 6694e4f commit 4f62e93

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/nodejs.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ on:
99
- '**'
1010

1111
jobs:
12+
cleanup-runs:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: rokroskar/workflow-run-cleanup-action@master
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/master'"
19+
1220
lint-and-typecheck:
1321
name: Running TypeScript compiler & ESLint
1422
runs-on: ubuntu-latest
@@ -41,3 +49,35 @@ jobs:
4149
run: yarn lint:prettier:ci
4250
- name: check copyright headers
4351
run: yarn check-copyright-headers
52+
test:
53+
name: Node v${{ matrix.node-version }} on ${{ matrix.os }}
54+
strategy:
55+
fail-fast: false
56+
matrix:
57+
# https://github.com/actions/setup-node/issues/27
58+
node-version: [8.17.0, 10.x, 12.x, 13.x]
59+
# Windows tests are failing for whatever reason, so just do linux and mac for now
60+
os: [ubuntu-latest, macOS-latest]
61+
runs-on: ${{ matrix.os }}
62+
63+
steps:
64+
- uses: actions/checkout@v2
65+
- name: Get yarn cache
66+
id: yarn-cache
67+
run: echo "::set-output name=dir::$(yarn cache dir)"
68+
- uses: actions/cache@v1
69+
with:
70+
path: ${{ steps.yarn-cache.outputs.dir }}
71+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
72+
restore-keys: |
73+
${{ runner.os }}-node-${{ matrix.node-version }}-yarn-
74+
- name: Use Node.js ${{ matrix.node-version }}
75+
uses: actions/setup-node@v1
76+
with:
77+
node-version: ${{ matrix.node-version }}
78+
- name: install
79+
run: yarn install-no-ts-build
80+
- name: run tests
81+
run: yarn test-ci-partial
82+
env:
83+
CI: true

0 commit comments

Comments
 (0)