From fab19e9efecf29fcf2521bc01f5e8f8253be89cc Mon Sep 17 00:00:00 2001 From: Ilia Mashkov Date: Wed, 1 Jul 2026 08:14:40 +0300 Subject: [PATCH] ci: gitea actions pipeline (verify, e2e, tagged publish) --- .gitea/workflows/ci.yml | 84 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 .gitea/workflows/ci.yml diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..e089da0 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -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