Skip to content

Commit

Permalink
switch default tested branch from svelte-4 to main (svelte5) (#17)
Browse files Browse the repository at this point in the history
* switch default tested branch from svelte-4 to main (svelte5)

* fix: pick correct output file by svelte major for selftest script
  • Loading branch information
dominikg committed Apr 29, 2024
1 parent dc6f74f commit 478192a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ on:
description: "svelte branch to use"
required: true
type: string
default: "svelte-4"
default: "main"
repo:
description: "svelte repository to use"
required: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ecosystem-ci-selected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
description: "svelte ref to use"
required: true
type: string
default: "svelte-4"
default: "main"
repo:
description: "svelte repository to use"
required: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ecosystem-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on:
description: "svelte ref to use"
required: true
type: string
default: "svelte-4"
default: "main"
repo:
description: "svelte repository to use"
required: true
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- run: pnpm i --frozen-lockfile
- run: >-
pnpm tsx ecosystem-ci.ts
--${{ inputs.refType || github.event.client_payload.refType || 'branch' }} ${{ inputs.ref || github.event.client_payload.ref || 'svelte-4' }}
--${{ inputs.refType || github.event.client_payload.refType || 'branch' }} ${{ inputs.ref || github.event.client_payload.ref || 'main' }}
--repo ${{ inputs.repo || github.event.client_payload.repo || 'sveltejs/svelte' }}
${{ matrix.suite }}
id: ecosystem-ci-run
Expand All @@ -79,7 +79,7 @@ jobs:
env:
WORKFLOW_NAME: ci
REF_TYPE: ${{ inputs.refType || github.event.client_payload.refType || 'branch' }}
REF: ${{ inputs.ref || github.event.client_payload.ref || 'svelte-4' }}
REF: ${{ inputs.ref || github.event.client_payload.ref || 'main' }}
REPO: ${{ inputs.repo || github.event.client_payload.repo || 'sveltejs/svelte' }}
SUITE: ${{ matrix.suite }}
STATUS: ${{ job.status }}
Expand Down
2 changes: 1 addition & 1 deletion ecosystem-ci.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cli
.option('--repo <repo>', 'svelte repository to use', {
default: 'sveltejs/svelte',
})
.option('--branch <branch>', 'svelte branch to use', { default: 'svelte-4' })
.option('--branch <branch>', 'svelte branch to use', { default: 'main' })
.option('--tag <tag>', 'svelte tag to use')
.option('--commit <commit>', 'svelte commit sha to use')
.option('--release <version>', 'svelte release to use from npm registry')
Expand Down
7 changes: 5 additions & 2 deletions tests/_selftest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ export async function test(options: RunOptions) {
`invalid checkout, expected package.json with "name":"svelte-ecosystem-ci" in ${dir}`,
)
}
pkg.scripts.selftestscript =
"[ -f ../../svelte/packages/svelte/compiler.cjs ] || (echo 'svelte build failed' && exit 1)"
const compilerOutputFile =
options.svelteMajor === 4
? ' ../../svelte/packages/svelte/compiler.cjs'
: '../../svelte/packages/svelte/compiler/index.js'
pkg.scripts.selftestscript = `[ -f ${compilerOutputFile} ] || (echo 'svelte build failed' && exit 1)`
await fs.promises.writeFile(
pkgFile,
JSON.stringify(pkg, null, 2),
Expand Down
2 changes: 1 addition & 1 deletion utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ export async function setupSvelteRepo(options: Partial<RepoOptions>) {
await setupRepo({
repo,
dir: sveltePath,
branch: 'svelte-4',
branch: 'main',
shallow: true,
...options,
})
Expand Down

0 comments on commit 478192a

Please sign in to comment.