forked from lynx-family/lynx-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
248 lines (242 loc) · 8.44 KB
/
deploy-main.yml
File metadata and controls
248 lines (242 loc) · 8.44 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
name: Deploy
on:
push:
branches: [
"main",
"release/*",
]
# Set default minimum permissions to prevent unnecessary access
permissions: {}
env:
CI: 1
TURBO_TELEMETRY_DISABLED: 1
GITHUB_BASE_REF: ${{ github.base_ref }}
GITHUB_HEAD_REF: ${{ github.head_ref }}
GITHUB_REF: ${{ github.ref }}
NPM_CONFIG_PROVENANCE: true
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
if: github.repository == 'lynx-family/lynx-stack'
permissions:
contents: read
actions: read
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@1780873c7b576612439a134613cc4cc74ce5538c # v1
with:
cache: false
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "24"
package-manager-cache: false
- name: Install
run: |
npm install -g corepack@latest
corepack enable && corepack prepare
corepack pnpm install --frozen-lockfile
- name: build
run: |
corepack pnpm turbo --filter !benchx_cli --filter "!@lynx-js/benchmark-*" build --summarize
- name: Save Turbo Result
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: deploy-${{ github.sha }}
path: .turbo
if-no-files-found: error
retention-days: 1
overwrite: true
include-hidden-files: true
# We make a build here to make sure cache works for pull requests
# See: https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/caching-dependencies-to-speed-up-workflows#restrictions-for-accessing-a-cache
build-all:
concurrency:
group: ${{ github.workflow }}-build-${{ github.ref }}
cancel-in-progress: false
uses: ./.github/workflows/workflow-build.yml
if: github.repository == 'lynx-family/lynx-stack'
permissions: {}
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
benchmark:
needs: build-all
uses: ./.github/workflows/workflow-bench.yml
permissions: {}
bundle-analysis:
permissions: {}
needs: build-all
uses: ./.github/workflows/workflow-bundle-analysis.yml
if: github.repository == 'lynx-family/lynx-stack'
coverage:
needs: build-all
uses: ./.github/workflows/workflow-test.yml
if: github.repository == 'lynx-family/lynx-stack'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
runs-on: lynx-ubuntu-24.04-medium
run: >
pnpm run test
--testTimeout=50000
--hookTimeout=50000
--reporter=dot
--reporter=junit
--outputFile=test-report.junit.xml
--coverage
--no-cache
--logHeapUsage
--silent
coverage-web-elements:
needs: build-all
uses: ./.github/workflows/workflow-test.yml
if: github.repository == 'lynx-family/lynx-stack'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
runs-on: lynx-custom-container
is-web: true
run: |
ulimit -Sn 655350
export NODE_OPTIONS="--max-old-space-size=32768"
export PLAYWRIGHT_JUNIT_OUTPUT_NAME=test-report.junit.xml
pnpm --filter @lynx-js/web-elements run test --reporter='github,dot,junit,html'
pnpm --filter @lynx-js/web-elements run coverage:ci
coverage-web-core:
needs: build-all
uses: ./.github/workflows/workflow-test.yml
if: github.repository == 'lynx-family/lynx-stack'
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
runs-on: lynx-custom-container
is-web: true
run: |
ulimit -Sn 655350
export NODE_OPTIONS="--max-old-space-size=32768"
export PLAYWRIGHT_JUNIT_OUTPUT_NAME=test-report.junit.xml
pnpm --filter @lynx-js/web-core-e2e run test --reporter='github,dot,junit,html'
pnpm --filter @lynx-js/web-core-e2e run coverage:ci
publish:
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
if: github.repository == 'lynx-family/lynx-stack'
concurrency:
group: ${{ github.workflow }}-publish-${{ github.ref }}
cancel-in-progress: false
environment: npm
permissions:
contents: write
pull-requests: write
statuses: read
# `id-token: write` is required for npm provenance
# See: https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
id-token: write
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false
- name: Install
run: |
npm install -g corepack@latest
corepack enable && corepack prepare
corepack pnpm install --frozen-lockfile
- name: Download Turbo Cache
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
timeout-minutes: 5
with:
name: deploy-${{ github.sha }}
path: .turbo
- name: build
run: |
corepack pnpm turbo build --filter !benchx_cli --filter "!@lynx-js/benchmark-*" --summarize
- name: Get current date
id: date
run: echo "::set-output name=date::$(date -u +'%Y-%m-%d %H:%M:%S')"
- name: attempt to release
uses: changesets/action@6a0a831ff30acef54f2c6aa1cbbc1096b066edaf # v1.7.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
publish: pnpm changeset publish
title: "chore: Release ${{ steps.date.outputs.date }}"
canary-publish:
timeout-minutes: 30
needs: build
runs-on: ubuntu-latest
if: github.repository == 'lynx-family/lynx-stack'
environment: npm
permissions:
contents: read
pull-requests: read
statuses: read
# `id-token: write` is required for npm provenance
# See: https://docs.npmjs.com/generating-provenance-statements#publishing-packages-with-provenance-via-github-actions
id-token: write
steps:
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "24"
registry-url: "https://registry.npmjs.org"
package-manager-cache: false
- name: Install
run: |
npm install -g corepack@latest
corepack enable && corepack prepare
corepack pnpm install --frozen-lockfile
- name: Download Turbo Cache
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5
timeout-minutes: 5
with:
name: deploy-${{ github.sha }}
path: .turbo
- name: build
run: |
corepack pnpm turbo --filter !benchx_cli --filter "!@lynx-js/benchmark-*" build --summarize
- name: version canary packages
env:
# changesets-changelog-github requires a GITHUB_TOKEN
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pnpm changeset version --snapshot canary
node packages/tools/canary-release/snapshot.js
- name: publish canary packages
run: |
pnpm --recursive publish --no-git-checks --access public
website-build:
needs: build-all
if: github.repository == 'lynx-family/lynx-stack'
uses: ./.github/workflows/workflow-website.yml
permissions: {}
website-deploy:
timeout-minutes: 10
needs: website-build
if: github.repository == 'lynx-family/lynx-stack'
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write # to deploy to Pages
id-token: write # to verify the deployment originates from an appropriate source
contents: read
# Deploy to the github-pages environment
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4