Skip to content

Commit

Permalink
chore: copy CI matrix from vite-plugin-svelte, and adjust engines rules
Browse files Browse the repository at this point in the history
  • Loading branch information
rixo committed Jul 12, 2023
1 parent 73428d8 commit dce2fd6
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 36 deletions.
29 changes: 27 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,51 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest ]
node: [ 14, 16, 18 ]
node: [16]
os: [ubuntu-latest, macos-latest, windows-latest]
svelte: [4]
include:
- node: 14
os: ubuntu-latest
svelte: 3
- node: 18
os: ubuntu-latest
svelte: 4
- node: 20
os: ubuntu-latest
svelte: 4
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: install pnpm
if: matrix.node != 14
shell: bash
run: |
PNPM_VER=$(jq -r '.packageManager | if .[0:5] == "pnpm@" then .[5:] else "packageManager in package.json does not start with pnpm@\n" | halt_error(1) end' package.json)
echo installing pnpm version $PNPM_VER
npm i -g pnpm@$PNPM_VER
- name: install legacy pnpm for node14
if: matrix.node == 14
run: |
npm i -g pnpm@^7.33.0
tmppkg="$(jq '.engines.pnpm = "^7.33.0"' package.json)" && echo -E "${tmppkg}" > package.json && tmppkg=""
- name: use svelte 3
if: matrix.svelte == 3
run: |
tmppkg="$(jq '.devDependencies.svelte = "^3.59.2"' package.json)" && echo -E "${tmppkg}" > package.json && tmppkg=""
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
cache-dependency-path: '**/pnpm-lock.yaml'
- name: install
if: matrix.node != 14 && matrix.svelte != 3
run: pnpm install --frozen-lockfile --prefer-offline
- name: install for node14 or svelte3
if: matrix.node == 14 || matrix.svelte == 3
run: pnpm install --no-frozen-lockfile --prefer-offline
- name: install playwright chromium
run: cd playground && pnpm playwright install chromium
- name: run tests
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
"type": "git",
"url": "https://github.com/sveltejs/svelte-hmr"
},
"packageManager": "pnpm@7.1.0",
"packageManager": "pnpm@7.33.3",
"engines": {
"pnpm": "^7.1.0"
"pnpm": "^7.33.3"
},
"pnpm": {
"overrides": {
"svelte-hmr": "workspace:*",
"semver@<7.5.2": ">=7.5.2"
"semver@<7.5.2": ">=7.5.2",
"svelte": "$svelte"
},
"peerDependencyRules": {
"ignoreMissing": [
Expand Down
4 changes: 2 additions & 2 deletions packages/svelte-hmr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
"runtime"
],
"engines": {
"node": ">= 16"
"node": "^14.18.0 || >= 16"
},
"peerDependencies": {
"svelte": "^3.19.0 || ^4.0.0-next.0"
"svelte": "^3.54.0 || ^4.0.0"
},
"devDependencies": {
"dotenv": "^10.0.0"
Expand Down
53 changes: 24 additions & 29 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit dce2fd6

Please sign in to comment.