-
Notifications
You must be signed in to change notification settings - Fork 2
121 lines (113 loc) · 3.48 KB
/
Copy pathci-pr.yml
File metadata and controls
121 lines (113 loc) · 3.48 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: CI - Pull Request
on:
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
gql-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm --filter @ghx-dev/core run gql:verify
build-and-test:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
NX_NO_CLOUD: ${{ vars.NX_NO_CLOUD }}
strategy:
fail-fast: false
matrix:
node-version: [22, 24]
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v5
- run: pnpm run ci:affected
- name: Detect Codecov report files (Node 24)
if: ${{ always() && matrix.node-version == 24 && !cancelled() }}
id: reports
run: |
shopt -s nullglob
coverage_files=(packages/*/coverage/lcov.info)
junit_files=(packages/*/test-report.junit.xml)
if [ ${#coverage_files[@]} -gt 0 ]; then
echo "coverage_found=true" >> "$GITHUB_OUTPUT"
else
echo "coverage_found=false" >> "$GITHUB_OUTPUT"
fi
if [ ${#junit_files[@]} -gt 0 ]; then
echo "junit_found=true" >> "$GITHUB_OUTPUT"
else
echo "junit_found=false" >> "$GITHUB_OUTPUT"
fi
- name: Upload coverage to Codecov (Node 24)
if: ${{ always() && matrix.node-version == 24 && !cancelled() && steps.reports.outputs.coverage_found == 'true' }}
uses: codecov/codecov-action@v7
with:
files: packages/*/coverage/lcov.info
flags: pr
use_oidc: true
fail_ci_if_error: true
- name: Upload test results to Codecov (Node 24)
if: ${{ always() && matrix.node-version == 24 && !cancelled() && steps.reports.outputs.junit_found == 'true' }}
uses: codecov/codecov-action@v7
with:
files: packages/*/test-report.junit.xml
report_type: test_results
flags: pr
use_oidc: true
fail_ci_if_error: true
audit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Audit dependencies
run: pnpm audit --audit-level=high
e2e:
runs-on: ubuntu-latest
permissions:
contents: read
env:
GH_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ github.token }}
NX_NO_CLOUD: ${{ vars.NX_NO_CLOUD }}
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@v5
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: pnpm
- name: Install opencode
run: curl -fsSL https://opencode.ai/install | bash
- run: pnpm install --frozen-lockfile
- name: E2E tests
run: pnpm run test:e2e