-
Notifications
You must be signed in to change notification settings - Fork 3
162 lines (156 loc) · 4.68 KB
/
ecosystem-ci-selected.yml
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
# integration tests for rspack ecosystem - run for selected one testsuite or all testsuites
name: rspack-ecosystem-ci-selected
env:
# 7 GiB by default on GitHub, setting to 6 GiB
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources
NODE_OPTIONS: --max-old-space-size=6144
on:
workflow_dispatch:
inputs:
refType:
description: "type of rspack ref to use"
required: true
type: choice
options:
- branch
- tag
- commit
- release
default: "branch"
ref:
description: "rspack ref to use"
required: true
type: string
default: "main"
repo:
description: "rspack repository to use"
required: true
type: string
default: "web-infra-dev/rspack"
suite:
description: "testsuite to run. runs all testsuits when `-`."
required: true
type: choice
options:
- "-"
- modernjs
# - nx
- rspress
- rsbuild
- rslib
- rsdoctor
- examples
- devserver
suiteRefType:
description: "type of suite ref to use"
required: true
type: choice
options:
- precoded
- branch
- tag
- commit
default: "precoded"
suiteRef:
description: "suite ref to use"
required: true
type: string
default: "precoded"
jobs:
get-runner-labels:
name: Get Runner Labels
needs: create-comment
uses: ./.github/workflows/get-runner-labels.yml
prepare-binding:
name: Prepare Rspack Binding
needs: get-runner-labels
runs-on: ${{ fromJSON(needs.get-runner-labels.outputs.LINUX_RUNNER_LABELS) }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/prepare-rspack-binding
with:
repository: ${{ inputs.repo }}
ref: ${{ inputs.suiteRef }}
execute-selected-suite:
needs: prepare-binding
runs-on: ubuntu-latest
if: "inputs.suite != '-'"
steps:
- uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
- uses: ./.github/actions/build-rspack
with:
ref: ${{ inputs.suiteRef }}
- run: pnpm i --frozen-lockfile
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- run: >-
pnpm tsx ecosystem-ci.ts
run-suites
--suite-${{ inputs.suiteRefType }} ${{ inputs.suiteRef }}
${{ inputs.suite }}
- if: always()
run: pnpm tsx discord-webhook.ts
env:
WORKFLOW_NAME: ci-selected-one
REF_TYPE: ${{ inputs.refType }}
REF: ${{ inputs.ref }}
REPO: ${{ inputs.repo }}
SUITE: ${{ inputs.suite }}
SUITE_REF_TYPE: ${{ inputs.suiteRefType }}
SUITE_REF: ${{ inputs.suiteRef }}
STATUS: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
execute-all:
needs: [get-runner-labels, prepare-binding]
if: "inputs.suite == '-'"
strategy:
matrix:
include:
- suite: modernjs
os: ubuntu-latest
# - suite: nx
# os: ubuntu-latest
- suite: rspress
os: ubuntu-latest
- suite: rslib
os: ubuntu-latest
- suite: rsbuild
os: ubuntu-latest
- suite: rsdoctor
os: ubuntu-latest
- suite: examples
os: ubuntu-latest
- suite: devserver
os: ubuntu-latest
- suite: nuxt
os: ubuntu-latest
fail-fast: false
runs-on: ${{ matrix.os }}
name: execute-all (${{ matrix.suite }})
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/build-rspack
with:
ref: ${{ inputs.suiteRef }}
- run: pnpm i --frozen-lockfile
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- run: >-
pnpm tsx ecosystem-ci.ts
run-suites
${{ matrix.suite }}
- if: always()
run: pnpm tsx discord-webhook.ts
env:
WORKFLOW_NAME: ci-selected-all
REF_TYPE: ${{ inputs.refType }}
REF: ${{ inputs.ref }}
REPO: ${{ inputs.repo }}
SUITE: ${{ matrix.suite }}
SUITE_REF_TYPE: ${{ inputs.suiteRefType }}
SUITE_REF: ${{ inputs.suiteRef }}
STATUS: ${{ job.status }}
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}