-
-
Notifications
You must be signed in to change notification settings - Fork 24
76 lines (66 loc) · 2.27 KB
/
test.yml
File metadata and controls
76 lines (66 loc) · 2.27 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
name: Test
on:
pull_request:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
node: [ 22, 24 ]
env:
FORCE_COLOR: 1
name: Node ${{ matrix.node }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@903f9c1a6ebcba6cf41d87230be49611ac97822e # v6
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6
env:
FORCE_COLOR: 0
with:
node-version: ${{ matrix.node }}
cache: pnpm
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5
with:
path: .nx/cache
key: nx-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}-${{ github.sha }}
restore-keys: |
nx-${{ runner.os }}-node${{ matrix.node }}-${{ hashFiles('pnpm-lock.yaml') }}-
nx-${{ runner.os }}-node${{ matrix.node }}-
- uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5
if: github.event_name == 'pull_request'
- run: pnpm install --prefer-offline --frozen-lockfile
- run: pnpm format:check
- name: Test affected (PRs)
if: github.event_name == 'pull_request'
run: pnpm exec nx affected -t test --output-style=static
- name: Test all (main)
if: github.event_name == 'push'
run: pnpm test:ci
- uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6
- uses: tryghost/actions/actions/slack-build@46ce4046333519b93109b3db80bb7f279828b3c8 # main
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
test-results:
runs-on: ubuntu-latest
name: All tests passed
needs: [test]
if: always()
steps:
- run: |
result="${{ needs.test.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi