-
Notifications
You must be signed in to change notification settings - Fork 4
54 lines (46 loc) · 1.43 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
# .github/workflows/ci.yml
# Continuous Integration (CI) Workflow
name: ci
# Run this workflow whenever a push is made to any branch or when there's a pull request
on:
pull_request:
branches:
- '*'
push:
branches:
- '*'
jobs:
lint:
name: ESLint
runs-on: ubuntu-latest
steps:
# https://github.com/actions/checkout
- name: Check out code
uses: actions/checkout@v4
# https://github.com/actions/setup-node
- name: Setup node
uses: actions/setup-node@v4
with:
# Use the latest lts version of node
node-version: 'lts/*'
# Cache npm dependencies so they don't have to be downloaded next time - https://github.com/actions/setup-node#caching-packages-dependencies
cache: 'npm'
- name: Install node dependencies
# Use `ci` vs. `install`, see https://docs.npmjs.com/cli/v8/commands/npm-ci
run: npm ci
- name: Run ESLint
run: npm run lint
unit-tests:
name: Unit Tests
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'npm'
- name: Install node dependencies and run tests
# Runs `npm ci` and `npm test` in one step. See: https://docs.npmjs.com/cli/v8/commands/npm-install-ci-test
run: npm install-ci-test