Files
mtusi2026lab2/.github/workflows/app.yml
T

53 lines
1.7 KiB
YAML

name: Application
on: [push, pull_request]
permissions:
contents: read
defaults:
run:
# Explicit bash turns on `-eo pipefail`, so a failing check behind `| tee` fails the job.
shell: bash
env:
BASE_URL: http://localhost:8080
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.27.1'
- run: go vet ./...
- run: go test -race -count=1 ./...
e2e:
runs-on: ubuntu-latest
needs: unit
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.27.1'
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- run: make secrets
- run: docker compose up -d --build --wait
- run: mkdir -p evidence-ci
- name: Public smoke
run: make test PYTHON=python BASE_URL="$BASE_URL" | tee evidence-ci/smoke.txt
- name: Persistence across a restart of the API and both stores
run: make test-persistence PYTHON=python BASE_URL="$BASE_URL" ACTION_SCRIPT=scripts/restart.sh | tee evidence-ci/persistence.txt
- name: Concurrency check
run: go run ./tools/concurrency --base-url "$BASE_URL" --output evidence-ci/concurrency.json
- name: Container logs
if: always()
run: docker compose logs > evidence-ci/compose.log 2>&1 || true
- name: Cleanup
# The CI stand is disposable, so its volumes go too.
if: always()
run: docker compose down -v || true
- uses: actions/upload-artifact@v4
if: always()
with:
name: evidence
path: evidence-ci