-
Notifications
You must be signed in to change notification settings - Fork 17
90 lines (83 loc) · 2.36 KB
/
js.yml
File metadata and controls
90 lines (83 loc) · 2.36 KB
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
83
84
85
86
87
88
89
90
name: JavaScript CI
on:
push:
branches:
- main
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
request:
runs-on: ubuntu-24.04
outputs:
run: ${{ steps.filter.outputs.run }}
steps:
- uses: envoyproxy/toolshed/actions/github/should-run@5e0c5734ee7fc8a30629bd3f54fc910f92285bbe
id: filter
with:
config: |
paths:
- 'js/**'
- '.github/workflows/js.yml'
js:
runs-on: ubuntu-24.04
needs: request
if: fromJSON(needs.request.outputs.run)
strategy:
fail-fast: false
matrix:
node-version:
- 20.x
name:
- appauth
- dispatch
- github/checks
- github/mutex
- github/script/run
- hashfiles
- jq
- retest
- torun
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
with:
node-version: ${{ matrix.node-version }}
# Use --legacy-peer-deps due to peer dependency conflict:
# @typescript-eslint/eslint-plugin@8.55.0 requires eslint ^8.57.0 || ^9.0.0
# but the project uses eslint@10.0.0 (not yet supported by typescript-eslint)
- run: npm ci --legacy-peer-deps
working-directory: js/${{ matrix.name }}
- run: npm run lint
working-directory: js/${{ matrix.name }}
- run: npm test
working-directory: js/${{ matrix.name }}
- run: |
npm run build
if [[ $(git status --porcelain) ]]; then
echo 'Built javascript does not match, did you run `npm run build`?' >&2
git status
git diff
exit 1
fi
working-directory: js/${{ matrix.name }}
status:
runs-on: ubuntu-24.04
if: >-
always()
&& github.event_name == 'pull_request'
name: JavaScript
needs:
- request
- js
steps:
- run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" || "${{ contains(needs.*.result, 'cancelled') }}" == "true" ]]; then
echo "One or more jobs failed or were cancelled"
exit 1
fi
echo "All required jobs passed or were skipped"