The Forgejo runner uses catthehacker/ubuntu:act-latest which does not have a real GitHub Actions cache backend. actions/setup-node@v4 with cache: npm spends ~4m44s trying to restore a non-existent cache during setup, and then ~4m40s in the post-job hook trying to save the cache during 'Complete job'. - Remove cache: npm and cache-dependency-path from setup-node step - npm ci without cache is fast enough for this project size (~10-20s) Expected result: lint-and-test job drops from ~11m to ~2m total.
79 lines
2.1 KiB
YAML
79 lines
2.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [master, develop]
|
|
pull_request:
|
|
branches: [master, develop]
|
|
|
|
jobs:
|
|
lint-and-test:
|
|
name: Lint, type check, unit tests, coverage
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
git init
|
|
git remote add origin https://x-access-token:${FORGEJO_TOKEN}@srvr.nu/git/jocke/bilhej.git
|
|
git fetch --depth 1 origin ${GITHUB_SHA}
|
|
git checkout FETCH_HEAD
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 24
|
|
|
|
- uses: https://github.com/actions/setup-java@v4
|
|
with:
|
|
distribution: temurin
|
|
java-version: 21
|
|
|
|
- name: Install frontend dependencies
|
|
run: npm ci
|
|
working-directory: frontend
|
|
|
|
- name: Lint
|
|
run: npm run lint
|
|
working-directory: frontend
|
|
|
|
- name: Type check
|
|
run: npx vue-tsc --noEmit
|
|
working-directory: frontend
|
|
|
|
- name: Frontend unit tests
|
|
run: npm run test
|
|
working-directory: frontend
|
|
|
|
- name: Backend unit tests
|
|
run: ./gradlew :backend:test
|
|
|
|
- name: Backend coverage
|
|
run: ./gradlew :backend:jacocoTestCoverageVerification
|
|
|
|
- name: Frontend coverage
|
|
run: npm run test:coverage
|
|
working-directory: frontend
|
|
|
|
e2e:
|
|
name: E2E browser tests
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
POSTGRES_DB: bilhej
|
|
POSTGRES_USER: bilhej
|
|
POSTGRES_PASSWORD: test_pw_ci_123
|
|
JWT_SECRET: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
STRIPE_SECRET_KEY: sk_test_fake
|
|
STRIPE_WEBHOOK_SECRET: whsec_fake
|
|
STRIPE_PRICE_ID: price_fake
|
|
steps:
|
|
- name: Checkout repository
|
|
run: |
|
|
git init
|
|
git remote add origin https://x-access-token:${FORGEJO_TOKEN}@srvr.nu/git/jocke/bilhej.git
|
|
git fetch --depth 1 origin ${GITHUB_SHA}
|
|
git checkout FETCH_HEAD
|
|
|
|
- name: Run E2E test stack
|
|
run: |
|
|
docker compose \
|
|
-f docker-compose.e2e.yml \
|
|
up --build --abort-on-container-exit --exit-code-from playwright
|