Skip to content

Improve error message #209

Improve error message

Improve error message #209

Workflow file for this run

name: main tests
on:
push:
workflow_dispatch:
jobs:
build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Derive version from latest git tag
id: gitver
shell: bash
run: |
VERSION="$(git describe | sed 's/^v//')"
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "Using version: $VERSION"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./bblab.dockerfile
target: bblab-site
push: ${{ github.ref == 'refs/heads/main' }}
tags: |
ghcr.io/cfe-lab/bblab-site:${{ steps.gitver.outputs.version }}
ghcr.io/cfe-lab/bblab-site:latest
load: true
cache-from: type=gha,scope=docker-bblab-server
cache-to: type=gha,mode=max,scope=docker-bblab-server
- name: Run pytest tests
run: |
docker run --rm \
-w /alldata/bblab_site \
ghcr.io/cfe-lab/bblab-site \
uv run pytest -v
- name: Run Django tests
run: |
docker run --rm \
--env-file ./compose-template.env \
-w /alldata/bblab_site \
ghcr.io/cfe-lab/bblab-site \
uv run python manage.py test --noinput