ci: gitea actions pipeline (verify, e2e, tagged publish)
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
name: CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
tags: ['v*']
|
||||
pull_request:
|
||||
branches: [main]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
verify:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with: { node-version: '25' }
|
||||
- name: Enable Corepack
|
||||
run: |
|
||||
corepack enable
|
||||
corepack prepare yarn@4.11.0 --activate
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: .yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-yarn-
|
||||
- run: yarn install --immutable
|
||||
- name: Lint + format check
|
||||
run: yarn lint
|
||||
- name: Type check
|
||||
run: yarn check
|
||||
- name: Unit tests + coverage
|
||||
run: yarn test:coverage
|
||||
- name: Build
|
||||
run: yarn build
|
||||
- name: Size budgets
|
||||
run: yarn size
|
||||
|
||||
e2e:
|
||||
needs: verify
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: mcr.microsoft.com/playwright:v1.59.0-jammy
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Enable Corepack
|
||||
run: |
|
||||
corepack enable
|
||||
corepack prepare yarn@4.11.0 --activate
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: .yarn/cache
|
||||
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
|
||||
restore-keys: ${{ runner.os }}-yarn-
|
||||
- run: yarn install --immutable
|
||||
- name: Build
|
||||
run: yarn build
|
||||
- name: E2E (chromium + firefox)
|
||||
timeout-minutes: 15
|
||||
run: yarn test:e2e
|
||||
|
||||
publish:
|
||||
needs: [verify, e2e]
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with: { node-version: '25' }
|
||||
- name: Enable Corepack
|
||||
run: |
|
||||
corepack enable
|
||||
corepack prepare yarn@4.11.0 --activate
|
||||
- run: yarn install --immutable
|
||||
- name: Assert tag matches package.json version
|
||||
run: |
|
||||
TAG="${GITHUB_REF_NAME#v}"
|
||||
PKG="$(node -p "require('./package.json').version")"
|
||||
test "$TAG" = "$PKG" || { echo "tag v$TAG != package.json $PKG"; exit 1; }
|
||||
- name: Build
|
||||
run: yarn build
|
||||
- name: Publish to Gitea registry
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.CI_DEPLOY_TOKEN }}
|
||||
run: npm publish
|
||||
Reference in New Issue
Block a user