-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (36 loc) · 859 Bytes
/
tests.yml
File metadata and controls
39 lines (36 loc) · 859 Bytes
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
name: tests
on:
workflow_call:
pull_request:
branches: ["main"]
paths-ignore:
- '.devcontainer/**'
- '.github/workflows/**'
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use Node.js 22.x
uses: actions/setup-node@v4
with:
node-version: '22.x'
- run: npm install
- run: npm run lint
- run: npm test
tests:
name: tests
needs: [test]
runs-on: ubuntu-latest
if: always()
steps:
- name: Check test results
run: |
results=($(echo '${{ toJSON(needs.*.result) }}' | jq -r '.[]'))
for r in "${results[@]}"; do
if [[ "$r" != "success" ]]; then
echo "One or more jobs failed: $r"
exit 1
fi
done
echo "All jobs passed"