-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (49 loc) · 1.37 KB
/
tests.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
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm test
use-in-a-client-project:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- name: Pack our shareable config
run: |
mkdir ${{ runner.temp }}/packed
npm pack --pack-destination ${{ runner.temp }}/packed
- name: Create a client project
working-directory: ${{ runner.temp }}
run: |
mkdir some-project
cd some-project
npm init -y
touch index.js
- name: Install our config in the client project
working-directory: ${{ runner.temp }}/some-project
run: |
npm install --save-dev ../packed/*.tgz
- name: Use shareable config (also checks peer dependencies)
working-directory: ${{ runner.temp }}/some-project
run: |
echo '{ "extends": "pa11y" }' > .eslintrc.json
npx --no eslint .