This repository has been archived by the owner on Oct 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
82 lines (79 loc) · 2.29 KB
/
test.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Test Workflow
on:
# Triggers the workflow on push events
push:
# Triggers the workflow on pull request events
pull_request:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Format check'
cmd: 'npm run format:check'
- name: 'Unit tests'
cmd: 'npm run test'
- name: 'Build'
cmd: 'npm run build'
name: '${{ matrix.name }}'
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-node-
- name: Install Deps
run: npm ci --ignore-scripts
- name: ${{ matrix.name }}
run: ${{ matrix.cmd }}
test-bc:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: 'Test with Eslint v7'
cmd: |
npm i eslint@^7 \
typescript-eslint-utils-5@npm:@typescript-eslint/utils@^5.57.0
cat package-lock.json | grep -A 1 \
-e "\"node_modules/eslint\": {" \
-e "\"node_modules/typescript-eslint-utils-5\": {" \
test: npm run test
build: npm run build
- name: 'Test with Typescript v4'
cmd: |
npm i typescript@^4.2
cat package-lock.json | grep -A 1 \
-e "\"node_modules/typescript\": {"
test: npm run test
build: npm run build
name: '[BC] ${{ matrix.name }}'
steps:
- uses: actions/setup-node@v3
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: ~/.npm
key: npm-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
npm-node-
- name: Install Deps
run: npm ci --ignore-scripts
- name: Install BC deps
run: ${{ matrix.cmd }}
- name: Unit tests
if: matrix.test
run: ${{ matrix.test }}
- name: Build
if: matrix.build
run: ${{ matrix.build }}