-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
93 lines (86 loc) 路 3.38 KB
/
Copy pathpr.yml
File metadata and controls
93 lines (86 loc) 路 3.38 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
name: PR
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
cancel-in-progress: true
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
SERVER_PRESET: 'node-server'
permissions:
contents: read
jobs:
test:
name: Test
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
env:
TSR_TMP_DIR: ./tmp
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Start Nx Agents
run: |
codspeed_env_vars="ACTIONS_ID_TOKEN_REQUEST_TOKEN,ACTIONS_ID_TOKEN_REQUEST_URL,CI,GITHUB_ACTIONS,GITHUB_API_URL,GITHUB_BASE_REF,GITHUB_HEAD_REF,GITHUB_REF,GITHUB_REF_NAME,GITHUB_REF_TYPE,GITHUB_REPOSITORY,GITHUB_REPOSITORY_ID,GITHUB_RUN_ATTEMPT,GITHUB_RUN_ID,GITHUB_RUN_NUMBER,GITHUB_SERVER_URL,GITHUB_SHA,GITHUB_WORKFLOW,GITHUB_WORKFLOW_REF,GITHUB_WORKFLOW_SHA"
npx nx-cloud start-ci-run \
--distribute-on=".nx/workflows/dynamic-changesets.yaml" \
--with-env-vars="$codspeed_env_vars"
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Get base and head commits for `nx affected`
uses: nrwl/nx-set-shas@afb73a62d26e41464e9254689e1fd6122ee683c1 # v5.0.1
with:
main-branch-name: main
- name: Run Checks
run: pnpm run test:pr --parallel=3
- name: Run CodeSpeed Benchmarks
run: |
if [ -z "$CODSPEED_TOKEN" ] && { [ -z "$ACTIONS_ID_TOKEN_REQUEST_TOKEN" ] || [ -z "$ACTIONS_ID_TOKEN_REQUEST_URL" ]; }; then
echo "::notice::Skipping CodeSpeed benchmarks because neither CODSPEED_TOKEN nor GitHub OIDC auth is configured for Nx Agent execution."
exit 0
fi
pnpm nx run-many \
--projects=@benchmarks/client-nav,@benchmarks/ssr,@benchmarks/memory-client,@benchmarks/memory-server \
--targets=test:codspeed:react,test:codspeed:solid,test:codspeed:vue \
--outputStyle=stream
- name: Stop Nx Agents
if: ${{ always() }}
run: npx nx-cloud stop-all-agents
preview:
name: Preview
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Build Packages
run: pnpm run build:all
- name: Publish Previews
run: pnpx pkg-pr-new publish --pnpm './packages/*' --template './examples/*/*'
version-preview:
name: Version Preview
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
- name: Setup Tools
uses: TanStack/config/.github/setup@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main
- name: Changeset Preview
uses: TanStack/config/.github/changeset-preview@e4b48f16568324f76f467aa4c2aac2f05db632c3 # main