fix(lab): give Juice Shop a healthcheck that works on a distroless image #397
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| backend: | |
| name: backend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/backend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Set up uv | |
| uses: astral-sh/setup-uv@v6 | |
| with: | |
| version: "0.11.6" | |
| - name: Cache uv packages | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/uv | |
| key: ${{ runner.os }}-uv-${{ hashFiles('src/backend/pyproject.toml', 'src/backend/uv.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-uv- | |
| - name: Install backend dependencies | |
| run: uv sync --frozen --extra dev | |
| - name: Verify Alembic migrations and model drift | |
| env: | |
| JWT_SECRET_KEY: ci-jwt-secret-key-not-used-at-runtime | |
| LOG_INGEST_SHARED_SECRET: ci-log-ingest-secret-not-used-at-runtime | |
| DATABASE_URL: sqlite:///./ci_alembic_check.db | |
| run: | | |
| uv run alembic upgrade heads | |
| uv run alembic check | |
| - name: Run backend tests with coverage | |
| run: uv run pytest --cov=app | |
| - name: Run mypy | |
| run: uv run mypy app/ | |
| - name: Run ruff | |
| run: uv run ruff check app/ | |
| - name: Detect Polish diacritics in backend Python files | |
| working-directory: src/backend | |
| run: | | |
| status=0 | |
| grep -RIn --include='*.py' "[ąćęłńóśźżĄĆĘŁŃÓŚŹŻ]" app || status=$? | |
| if [ "$status" -eq 0 ]; then | |
| echo "Found Polish diacritics in backend Python files under src/backend/app." | |
| exit 1 | |
| fi | |
| if [ "$status" -ne 1 ]; then | |
| echo "grep failed while scanning backend Python files under src/backend/app." | |
| exit "$status" | |
| fi | |
| frontend: | |
| name: frontend | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: src/frontend | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| version: 10.30.0 | |
| run_install: false | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: .node-version | |
| cache: pnpm | |
| cache-dependency-path: src/frontend/pnpm-lock.yaml | |
| - name: Install frontend dependencies | |
| run: pnpm install --frozen-lockfile | |
| - name: Run frontend type-check | |
| run: pnpm run type-check | |
| - name: Run frontend lint | |
| run: pnpm run lint | |
| - name: Run frontend tests | |
| run: pnpm run test |