d8bfdc1733
The repo now contains the Flutter mobile client at flutter_client/ (M7 #356). Two cleanups so the existing build pipelines don't churn on Flutter-only changes: 1. .dockerignore — keep the Flutter project (and docs/, IDE noise, git metadata) out of the Docker build context. The runtime image was already unaffected (multi-stage drops everything but the Go binary), but the COPY . . layer cache invalidated on every Flutter edit. Build context shrinks ~2.4 MB and Flutter-only pushes no longer force Go rebuilds. 2. test.yml + release.yml — paths-ignore on flutter_client/**, docs/**, and **/*.md. Go/web tests + container build now skip when the diff doesn't touch them. Tag releases still build broadly since server + Flutter ship paired. The Flutter-side workflow lands in M7 Task 21 with its own paths filter restricting it to flutter_client/** and the shared web/ inputs (tokens.json, error-copy.json, album-fallback.svg).
76 lines
2.1 KiB
YAML
76 lines
2.1 KiB
YAML
name: test
|
|
|
|
# Lint + short unit tests. Integration tests needing Postgres/ffmpeg run
|
|
# locally via docker-compose; they should guard with testing.Short().
|
|
|
|
on:
|
|
# PRs against main are the gate. Direct pushes to dev no longer trigger
|
|
# CI on their own — opening a PR fires the pull_request event and gates
|
|
# the merge. Avoids the duplicate push+pull_request runs we were
|
|
# accumulating on every PR commit.
|
|
#
|
|
# paths-ignore skips this workflow when only Flutter-client files change;
|
|
# the Flutter workflow (.forgejo/workflows/flutter.yml) handles those.
|
|
pull_request:
|
|
branches: [main]
|
|
paths-ignore:
|
|
- 'flutter_client/**'
|
|
- 'docs/**'
|
|
- '**/*.md'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: go-ci
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: '22'
|
|
cache: 'npm'
|
|
cache-dependency-path: web/package-lock.json
|
|
|
|
- name: Install web deps
|
|
working-directory: web
|
|
run: npm ci
|
|
|
|
- name: Web build (populates web/build/ for go:embed)
|
|
working-directory: web
|
|
run: npm run build
|
|
|
|
- name: Web test (vitest)
|
|
working-directory: web
|
|
run: npm test
|
|
|
|
- name: Detect Go project
|
|
id: gomod
|
|
shell: bash
|
|
run: |
|
|
if [ -f go.mod ]; then
|
|
echo "present=true" >> "$GITHUB_OUTPUT"
|
|
else
|
|
echo "present=false" >> "$GITHUB_OUTPUT"
|
|
echo "::notice::No go.mod yet — Go steps will be skipped until the skeleton lands"
|
|
fi
|
|
|
|
- name: Toolchain versions
|
|
if: steps.gomod.outputs.present == 'true'
|
|
run: |
|
|
go version
|
|
golangci-lint --version
|
|
|
|
- name: go vet
|
|
if: steps.gomod.outputs.present == 'true'
|
|
run: go vet ./...
|
|
|
|
- name: golangci-lint
|
|
if: steps.gomod.outputs.present == 'true'
|
|
run: golangci-lint run ./...
|
|
|
|
- name: go test (short, race)
|
|
if: steps.gomod.outputs.present == 'true'
|
|
run: go test -short -race ./...
|