Skip to content

Commit

Permalink
chore(ci): Implement Wasm breaking mode
Browse files Browse the repository at this point in the history
  • Loading branch information
kdy1 committed Jul 18, 2024
1 parent fb3eabe commit c69e030
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/swc-ecosystem-ci/tests/plugin-css-variable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ export async function test(options: RunOptions) {
build: "build",
beforeBuild: "rustup target add wasm32-wasi",
test: ["test:swc"],
isWasm: true,
});
}
1 change: 1 addition & 0 deletions .github/swc-ecosystem-ci/tests/swc-plugin-vue-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ export async function test(options: RunOptions) {
branch: "main",
build: ["rustup target add wasm32-unknown-unknown", "build"],
test: ["test"],
isWasm: true,
});
}
1 change: 1 addition & 0 deletions .github/swc-ecosystem-ci/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export interface RunOptions {
* Passed to fnm
*/
nodeVerison?: string;
isWasm?: boolean
}

type Task = string | { script: string; args?: string[] } | (() => Promise<any>);
Expand Down
4 changes: 4 additions & 0 deletions .github/swc-ecosystem-ci/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ export async function runInRepo(options: RunOptions & RepoOptions) {
options.branch = "main";
}

if (process.env.ALLOW_BREAKING_WASM && options.isWasm) {
return;
}

const {
build,
test,
Expand Down
7 changes: 7 additions & 0 deletions .github/workflows/ecosystem-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ on:
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"
Expand Down Expand Up @@ -96,6 +102,7 @@ jobs:
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
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ jobs:
version: ${{ needs.determine-nightly-version.outputs.version }}
mode: "passing"
suites: '["_"]'
allowBreakingWasm: ${{ inputs.allowBreakingWasm || false }}

publish-npm-stable:
name: "Publish ${{ inputs.version || 'stable' }} to npm"
Expand Down

0 comments on commit c69e030

Please sign in to comment.