- Remove globalDependencies **/.env which invalidated all caches on any .env change - Move 40+ env vars from globalEnv to build-specific env (lint/format/typecheck don't need DB_URL etc.) - Add per-task inputs with test file exclusions so test changes don't trigger build/typecheck - Enable affectedUsingTaskInputs for task-level --affected detection - Add --affected to all turbo commands in CI (lint, format, typecheck, build) - Add fetch-depth: 0 for proper git history comparison - Add Docker Buildx + GHA layer caching for E2E builds
126 lines
2.7 KiB
YAML
126 lines
2.7 KiB
YAML
name: "[Quality] Code Analysis"
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
branches: ["*"]
|
|
push:
|
|
branches: ["main"]
|
|
merge_group:
|
|
|
|
concurrency:
|
|
group: "${{ github.workflow }}-${{ github.ref }}"
|
|
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
|
|
|
|
env:
|
|
FORCE_COLOR: 3
|
|
SKIP_ENV_VALIDATION: true
|
|
|
|
jobs:
|
|
lint:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup
|
|
uses: ./tooling/github/setup
|
|
|
|
- name: Copy env
|
|
shell: bash
|
|
run: cp .env.example .env
|
|
|
|
- name: Lint
|
|
run: pnpm turbo lint --affected && pnpm lint:ws
|
|
|
|
format:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup
|
|
uses: ./tooling/github/setup
|
|
|
|
- name: Format
|
|
run: pnpm turbo format --affected --continue -- --cache --cache-location node_modules/.cache/.prettiercache
|
|
|
|
typecheck:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Setup
|
|
uses: ./tooling/github/setup
|
|
|
|
- name: Typecheck
|
|
run: pnpm turbo typecheck --affected
|
|
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- name: Setup
|
|
uses: ./tooling/github/setup
|
|
|
|
- name: Test
|
|
run: pnpm test
|
|
|
|
- name: "Report Coverage"
|
|
if: always()
|
|
uses: davelosert/vitest-coverage-report-action@v2
|
|
|
|
e2e:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- name: Setup
|
|
uses: ./tooling/github/setup
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v4
|
|
- name: Build docker image
|
|
id: build-docker-image
|
|
uses: docker/build-push-action@v7
|
|
with:
|
|
platforms: linux/amd64
|
|
context: .
|
|
push: false
|
|
load: true
|
|
tags: homarr-e2e
|
|
network: host
|
|
cache-from: type=gha
|
|
cache-to: type=gha,mode=max
|
|
env:
|
|
SKIP_ENV_VALIDATION: true
|
|
- name: Install playwright browsers
|
|
run: pnpm exec playwright install chromium
|
|
- name: Run E2E Tests
|
|
shell: bash
|
|
run: pnpm test:e2e
|
|
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 10
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
with:
|
|
fetch-depth: 0
|
|
- name: Setup
|
|
uses: ./tooling/github/setup
|
|
- name: Copy env
|
|
shell: bash
|
|
run: cp .env.example .env
|
|
- name: Build
|
|
run: pnpm turbo build --affected
|