-
-
Notifications
You must be signed in to change notification settings - Fork 392
168 lines (133 loc) · 4.51 KB
/
build-and-test.yml
File metadata and controls
168 lines (133 loc) · 4.51 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: Build Affected Packages
permissions:
contents: read
actions: read
on:
pull_request:
branches: [main, '**']
push:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checkout-install:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Cache Tool Downloads
uses: actions/cache@v5
with:
path: ~/.cache
key: ${{ runner.os }}-toolcache-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-toolcache-
- name: Setup pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js 20
uses: actions/setup-node@v6
with:
node-version: '20'
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: Remove cached node_modules
run: rm -rf node_modules .nx
- name: Set Playwright cache status
run: |
if [ -d "$HOME/.cache/ms-playwright" ] || [ -d "$HOME/.cache/Cypress" ]; then
echo "PLAYWRIGHT_CACHE_HIT=true" >> "$GITHUB_ENV"
else
echo "PLAYWRIGHT_CACHE_HIT=false" >> "$GITHUB_ENV"
fi
- name: Set Nx SHA
uses: nrwl/nx-set-shas@v4
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright Browsers
run: pnpm exec playwright install --force
- name: Install Cypress
# if: steps.browsers-cache.outputs.cache-hit != 'true'
run: npx cypress install
- name: Check Code Format
run: npx nx format:check
- name: Verify Rslib Template Publint Wiring
run: node packages/create-module-federation/scripts/verify-rslib-templates.mjs
- name: Verify Package Rslib Publint Wiring
run: node tools/scripts/verify-rslib-publint-coverage.mjs
- name: Verify Publint Workflow Coverage
run: node tools/scripts/verify-publint-workflow-coverage.mjs
- name: Run Rslib Harness Tests
run: pnpm run test:rslib-harness
- name: Verify Rslib Harness Coverage
run: pnpm run verify:rslib-harness
- name: Verify Rslib Harness Workflow Coverage
run: pnpm run verify:rslib-harness:workflow
- name: Print Number of CPU Cores
run: nproc
- name: Run Build for All
run: |
npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4 --skip-nx-cache
npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
- name: Check Package Publishing Compatibility
run: |
for pkg in packages/*; do
if [ -f "$pkg/package.json" ] && \
[ "$pkg" != "packages/assemble-release-plan" ] && \
[ "$pkg" != "packages/chrome-devtools" ] && \
[ "$pkg" != "packages/core" ] && \
[ "$pkg" != "packages/modernjs" ] && \
[ "$pkg" != "packages/utilities" ]; then
echo "Checking $pkg..."
npx publint "$pkg"
fi
done
- name: Warm Nx Cache
run: npx nx run-many --targets=build --projects=tag:type:pkg --parallel=4
- name: Run Affected Test
timeout-minutes: 10
run: npx nx affected -t test --parallel=3 --exclude='*,!tag:type:pkg'
e2e-modern:
needs: checkout-install
uses: ./.github/workflows/e2e-modern.yml
secrets: inherit
e2e-runtime:
needs: checkout-install
uses: ./.github/workflows/e2e-runtime.yml
secrets: inherit
e2e-manifest:
needs: checkout-install
uses: ./.github/workflows/e2e-manifest.yml
secrets: inherit
e2e-node:
needs: checkout-install
uses: ./.github/workflows/e2e-node.yml
secrets: inherit
e2e-next-dev:
needs: checkout-install
uses: ./.github/workflows/e2e-next-dev.yml
secrets: inherit
e2e-next-prod:
needs: checkout-install
uses: ./.github/workflows/e2e-next-prod.yml
secrets: inherit
e2e-treeshake:
needs: checkout-install
uses: ./.github/workflows/e2e-treeshake.yml
secrets: inherit
e2e-modern-ssr:
needs: checkout-install
uses: ./.github/workflows/e2e-modern-ssr.yml
secrets: inherit
e2e-router:
needs: checkout-install
uses: ./.github/workflows/e2e-router.yml
secrets: inherit
e2e-metro:
needs:
- checkout-install
uses: ./.github/workflows/e2e-metro.yml
secrets: inherit