-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
104 lines (89 loc) · 2.99 KB
/
ecosystem-ci.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
name: Ecosystem CI
env:
CI: 1
# 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
FNM_COREPACK_ENABLED: true
FNM_RESOLVE_ENGINES: true
# https://github.com/actions/setup-node/issues/899#issuecomment-1819151595
SKIP_YARN_COREPACK_CHECK: 1
on:
workflow_call:
inputs:
version:
description: "swc version to use"
required: true
type: string
default: "nightly"
suites:
description: 'JSON array for test suites to run. Select ["_"] to run all tests'
required: true
type: string
allowBreakingWasm:
description: "Allow wasm breakage"
required: false
type: boolean
default: false
mode:
type: string
description: "Passing is a regular proces, and ignored is about ignored tests"
jobs:
list-tests:
name: "List tests"
timeout-minutes: 30
runs-on: ubuntu-latest
outputs:
suites: ${{ steps.list-tests.outputs.suites }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
- id: list-tests
run: yarn tsx run-all.ts
working-directory: .github/swc-ecosystem-ci
env:
CI_MODE: ${{ github.event.inputs.mode || 'passing' }}
run-test-suite:
name: Test ${{ matrix.suite }}
needs:
- list-tests
timeout-minutes: 30
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
suite: ${{ fromJSON(needs.list-tests.outputs.suites) }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node
- run: corepack enable
- run: yarn
- run: yarn tsc
working-directory: .github/swc-ecosystem-ci
- id: ecosystem-ci-run
working-directory: .github/swc-ecosystem-ci
run: |
bash -r
echo $PATH
which node
corepack disable
node ecosystem-ci.js run-suites ${{ matrix.suite }}
env:
SWC_VERSION: ${{ inputs.version }}
CI_MODE: ${{ inputs.mode }}
ALLOW_BREAKING_WASM: ${{ inputs.allowBreakingWasm || 'false' }}
# - if: ${{ failure() && github.event.inputs.mode == 'passing' }}
# name: Notify failure
# uses: tsickert/[email protected]
# with:
# webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
# content: |
# Test for `${{ matrix.suite }}` with `${{ inputs.version }}` failed.
# See https://github.com/swc-project/swc-ecosystem-ci/actions/runs/${{ github.run_id }} for details.
# - if: ${{ success() &&github.event.inputs.mode == 'ignored' }}
# name: Notify success
# uses: tsickert/[email protected]
# with:
# webhook-url: ${{ secrets.DISCORD_WEBHOOK_URL }}
# content: |
# Test `${{ matrix.suite }}` is now passing