-
-
Notifications
You must be signed in to change notification settings - Fork 393
143 lines (117 loc) · 3.69 KB
/
build-and-test.yml
File metadata and controls
143 lines (117 loc) · 3.69 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
name: Build Affected Packages
permissions:
contents: read
actions: read
on:
pull_request:
branches: [main, '**']
push:
branches: [main]
jobs:
checkout-install:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout Repository
uses: actions/checkout@v5
with:
fetch-depth: 0
- 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 Cypress
# if: steps.browsers-cache.outputs.cache-hit != 'true'
run: npx cypress install
- name: Check Code Format
run: npx nx format:check
- 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" ] && \
[ "$pkg" != "packages/metro-core" ] && \
[ "$pkg" != "packages/metro-plugin-rnef" ] && \
[ "$pkg" != "packages/metro-plugin-rnc-cli" ]; 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-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:
permissions:
contents: read
actions: read
checks: write
pull-requests: write
needs:
- checkout-install
- build-metro
uses: ./.github/workflows/e2e-metro.yml
secrets: inherit
build-metro:
uses: ./.github/workflows/build-metro.yml
secrets: inherit