-
-
Notifications
You must be signed in to change notification settings - Fork 11
56 lines (49 loc) · 1.53 KB
/
Copy pathtest.yml
File metadata and controls
56 lines (49 loc) · 1.53 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
name: Tests
# These integration tests hit the public Xbox Game Pass APIs (no credentials needed) to catch
# when Microsoft changes or retires an endpoint the tool depends on, even when the code is unchanged
on:
push:
branches:
- main
pull_request:
branches:
- main
schedule:
# every Monday at 06:00 UTC
- cron: "0 6 * * 1"
workflow_dispatch:
jobs:
test-matrix:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Test on the minimum supported version and the latest
node-version: [22, 24]
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
# A single, stable status check for branch protection that is green only when every matrix job
# passed. The matrix jobs report as "test-matrix (22)" etc, whose names change with the matrix,
# so requiring this job instead keeps the required check name stable
test:
if: always()
needs: test-matrix
runs-on: ubuntu-latest
steps:
- name: Verify the test matrix succeeded
run: |
if [ "${{ needs.test-matrix.result }}" != "success" ]; then
echo "The test matrix did not succeed (result: ${{ needs.test-matrix.result }})."
exit 1
fi
echo "All test matrix jobs passed."