-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.64 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Node.js CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Update NPM
run: npm install -g npm@">=7"
- name: Cache node modules
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- name: Install dependencies
run: npm ci
# We need to make sure eslint-plugin is built even if not affected, as we always run linting,
# which requires it
- name: Build eslint-plugin
run: npx nx build eslint-plugin
# Our lint-staged.config.mjs also relies on @eternagame/lint-staged-utils so that needs to be built to lint
- name: Build lint-staged-utils
run: npx nx build lint-staged-utils
- name: Build
run: npx nx affected --target=build
- name: Lint core files
run: npm run lint-core
- name: Lint packages
run: npx nx affected --target=lint
- name: Nx integrity check
run: npx nx workspace-lint
- name: Unit tests
run: npx nx affected --target=test
- name: End to end tests
run: npx nx affected --target e2e