These env vars (DB_*, AUTH_*, DOCKER_*, etc.) are all runtime configuration provided by users when running the Docker container. They don't influence the build output since Next.js standalone mode reads process.env at runtime and SKIP_ENV_VALIDATION=true skips validation during build. Listing them in build.env caused unnecessary cache busting in local dev. Also restores coverage report comments per review feedback.
134 lines
3.2 KiB
YAML
134 lines
3.2 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
|
|
TURBO_API: ${{ secrets.TURBO_API }}
|
|
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_REMOTE_CACHE_SIGNATURE_KEY: ${{ secrets.TURBO_REMOTE_CACHE_SIGNATURE_KEY }}
|
|
TURBO_SCM_BASE: ${{ github.event.pull_request.base.sha || github.event.before || 'HEAD~1' }}
|
|
TURBO_SCM_HEAD: ${{ github.sha }}
|
|
|
|
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"
|
|
# Set if: always() to also generate the report if tests are failing
|
|
# Only works if you set `reportOnFailure: true` in your vite config as specified above
|
|
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
|