Repository navigation
77 lines (66 loc) · 2.32 KB
/
Copy pathtest.yml
File metadata and controls
77 lines (66 loc) · 2.32 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
name: Test
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
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@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
with:
fetch-depth: 0
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7
env:
FORCE_COLOR: 0
with:
node-version: ${{ matrix.node }}
cache: pnpm
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
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@e602fada7ad5987b0f7b1905e7a99ea1c661514c # v5
if: github.event_name == 'pull_request'
- run: pnpm install --prefer-offline --frozen-lockfile
- run: pnpm format:check
- run: pnpm lint
- 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@303a32d7a59b442fa8d48b6a1cc6825c09c847a5 # v7
- uses: tryghost/actions/actions/slack-build@35c321c5dede55ff3d02ea89a2a494cbc13a468b # main
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
status: ${{ job.status }}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
required-checks-pass:
runs-on: ubuntu-latest
name: Required checks pass
permissions: {}
needs: [test]
if: always()
steps:
- name: Verify all required jobs succeeded
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
run: exit 1