Skip to content

Commit

Permalink
chore: support passing refs (#21)
Browse files Browse the repository at this point in the history
* chore: support passing refs

* chore: clean
  • Loading branch information
h-a-n-a authored Nov 15, 2023
1 parent 2b9c7ab commit 4bd36b6
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 3 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ on:
- rspress
- rsbuild
- compat
modernRef:
description: "modern.js branch name to use"
required: true
type: string
default: "main"
rspressRef:
description: "rspress branch name to use"
required: true
type: string
default: "main"
rsbuildRef:
description: "rsbuild branch name to use"
required: true
type: string
default: "main"
jobs:
init:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -78,6 +93,10 @@ jobs:
--branch ${{ inputs.branchName }}
--repo ${{ inputs.repo }}
${{ inputs.suite }}
env:
MODERN_REF: ${{ inputs.modernRef }}
RSPRESS_REF: ${{ inputs.rspressRef }}
RSBUILD_REF: ${{ inputs.rsbuildRef }}
execute-all:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -109,6 +128,10 @@ jobs:
--branch ${{ inputs.branchName }}
--repo ${{ inputs.repo }}
${{ matrix.suite }}
env:
MODERN_REF: ${{ inputs.modernRef }}
RSPRESS_REF: ${{ inputs.rspressRef }}
RSBUILD_REF: ${{ inputs.rsbuildRef }}
update-comment:
runs-on: ubuntu-latest
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/ecosystem-ci-selected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,21 @@ on:
- rspress
- rsbuild
- compat
modernRef:
description: "modern.js branch name to use"
required: true
type: string
default: "main"
rspressRef:
description: "rspress branch name to use"
required: true
type: string
default: "main"
rsbuildRef:
description: "rsbuild branch name to use"
required: true
type: string
default: "main"

jobs:
execute-selected-suite:
Expand All @@ -62,6 +77,10 @@ jobs:
--${{ inputs.refType }} ${{ inputs.ref }}
--repo ${{ inputs.repo }}
${{ inputs.suite }}
env:
MODERN_REF: ${{ inputs.modernRef }}
RSPRESS_REF: ${{ inputs.rspressRef }}
RSBUILD_REF: ${{ inputs.rsbuildRef }}
- if: always()
run: pnpm tsx discord-webhook.ts
env:
Expand Down
2 changes: 1 addition & 1 deletion tests/modernjs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function test(options: RunOptions) {
await runInRepo({
...options,
repo: 'web-infra-dev/modern.js',
branch: 'main',
branch: process.env.MODERN_REF ?? 'main',
beforeTest: async () => {
cd('tests/e2e/builder')
await $`pnpm playwright install chromium`
Expand Down
2 changes: 1 addition & 1 deletion tests/rsbuild.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function test(options: RunOptions) {
await runInRepo({
...options,
repo: 'web-infra-dev/rsbuild',
branch: 'main',
branch: process.env.RSBUILD_REF ?? 'main',
beforeTest: async () => {
cd('./e2e')
await $`pnpm playwright install`
Expand Down
2 changes: 1 addition & 1 deletion tests/rspress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export async function test(options: RunOptions) {
await runInRepo({
...options,
repo: 'web-infra-dev/rspress',
branch: 'main',
branch: process.env.RSPRESS_REF ?? 'main',
beforeTest: async () => {
await $`pnpm playwright install`
},
Expand Down

0 comments on commit 4bd36b6

Please sign in to comment.