Switch to pnpm (#36)

This commit is contained in:
Ollie Taylor
2023-02-26 15:40:03 +00:00
committed by GitHub
parent 084ed9fbbd
commit 47aabda96d
7 changed files with 3533 additions and 3189 deletions
+24 -22
View File
@@ -1,30 +1,32 @@
name: 'CI'
on:
pull_request:
push:
branches:
- '**'
- main
pull_request:
env:
# we call `pnpm playwright install` instead
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
# cancel in-progress runs on new commits to same PR (gitub.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: use node v16.x
uses: actions/setup-node@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
with:
node-version: 16.x
- name: yarn install
uses: borales/actions-yarn@v4
with:
cmd: install --frozen-lockfile
- name: prettier lint
uses: borales/actions-yarn@v4
with:
cmd: lint
- name: svelte check
uses: borales/actions-yarn@v4
with:
cmd: check
node-version: '16.x'
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm run check
+20 -10
View File
@@ -7,26 +7,36 @@ on:
concurrency: ${{ github.workflow }}-${{ github.ref }}
jobs:
build:
release:
# prevents this action from running on forks
if: github.repository == 'OllieJT/svelte-podcast'
permissions:
contents: write # to create release (changesets/action)
pull-requests: write # to create pull request (changesets/action)
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: use node v16.x
- name: Checkout Repo
uses: actions/checkout@v3
with:
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
fetch-depth: 0
- uses: pnpm/action-setup@v2.2.4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16.x
cache: pnpm
- name: yarn install
uses: borales/actions-yarn@v4
with:
cmd: install --frozen-lockfile
- run: pnpm install --frozen-lockfile
- name: Create Release Pull Request or Publish
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn run release
# This expects you to have a script called release which does a build for your packages and calls changeset publish
publish: pnpm release
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
UPDATE_TEMPLATE_SSH_KEY: ${{ secrets.UPDATE_TEMPLATE_SSH_KEY }}
+123
View File
@@ -0,0 +1,123 @@
name: 'CI'
on:
push:
branches:
- todo
env:
# we call `pnpm playwright install` instead
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: '1'
# cancel in-progress runs on new commits to same PR (gitub.event.number)
concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
Lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
with:
node-version: '16.x'
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm run lint
- run: pnpm run check
Tests:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node-version: 16
os: ubuntu-latest
e2e-browser: 'chromium'
- node-version: 18
os: ubuntu-latest
e2e-browser: 'chromium'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm test
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
retention-days: 3
name: test-failure-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
path: test-results.tar.gz
Cross-browser-test:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
include:
- node-version: 16
os: windows-2019 # slowness reported on newer versions https://github.com/actions/runner-images/issues/5166
e2e-browser: 'chromium'
mode: 'dev'
- node-version: 16
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'dev'
- node-version: 16
os: macOS-latest
e2e-browser: 'webkit'
mode: 'dev'
- node-version: 16
os: windows-2019 # slowness reported on newer versions https://github.com/actions/runner-images/issues/5166
e2e-browser: 'chromium'
mode: 'build'
- node-version: 16
os: ubuntu-latest
e2e-browser: 'firefox'
mode: 'build'
- node-version: 16
os: macOS-latest
e2e-browser: 'webkit'
mode: 'build'
env:
KIT_E2E_BROWSER: ${{matrix.e2e-browser}}
steps:
- run: git config --global core.autocrlf false
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm playwright install ${{ matrix.e2e-browser }}
- run: pnpm test:cross-platform:${{ matrix.mode }}
- name: Archive test results
if: failure()
shell: bash
run: find packages -type d -name test-results -not -empty | tar -czf test-results-cross-platform-${{ matrix.mode }}.tar.gz --files-from=-
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v3
with:
retention-days: 3
name: test-failure-cross-platform-${{ matrix.mode }}-${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }}-${{ matrix.e2e-browser }}
path: test-results-cross-platform-${{ matrix.mode }}.tar.gz