Skip to content

v0.2 wip

v0.2 wip #142

Workflow file for this run

# build and test
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
env:
# we call `pnpm playwright install` instead
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
jobs:
# "checks" job runs on linux + 16 only and checks that install, build, lint and audit work
# it also primes the pnpm store cache for linux, important for downstream tests
checks:
timeout-minutes: 5
runs-on: ${{ matrix.os }}
strategy:
matrix:
# pseudo-matrix for convenience, NEVER use more than a single combination
node: [16]
os: [ubuntu-latest]
outputs:
build_successful: ${{ steps.build.outcome == 'success' }}
steps:
- uses: actions/checkout@v3
- uses: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: install
run: pnpm install --frozen-lockfile --prefer-offline
# reactivate this when there is a build step
# - name: build
# id: build
# run: pnpm run build
- name: lint
if: (${{ success() }} || ${{ failure() }})
run: pnpm run lint
- name: audit
if: (${{ success() }} || ${{ failure() }})
run: pnpm audit
# this is the test matrix
# it is skipped if the build step of the checks job wasn't successful (still runs if lint or audit fail)
test:
needs: checks
if: (${{ success() }} || ${{ failure() }}) && (${{ needs.checks.output.build_successful }})
timeout-minutes: 10
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
node: [16]
os: [ubuntu-latest, macos-latest, windows-latest]
svelte: [4]
include:
# not compatible with pnpm 8...
# - 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: pnpm/[email protected]
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: 'pnpm'
- name: use svelte 3
if: matrix.svelte == 3
run: |
tmppkg="$(jq '.devDependencies.svelte = "^3.59.2"' package.json)" && echo -E "${tmppkg}" > package.json && tmppkg=""
- 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
run: pnpm test