Skip to content

Merge branch 'develop' into bugfix/compare-queries #141

Merge branch 'develop' into bugfix/compare-queries

Merge branch 'develop' into bugfix/compare-queries #141

Workflow file for this run

# This workflow will run backend tests on the Python version defined in the backend/Dockerfile
name: Backend unit tests
on:
workflow_dispatch:
push:
branches:
- 'develop'
- 'master'
- 'feature/**'
- 'bugfix/**'
- 'hotfix/**'
- 'release/**'
- 'dependabot/**'
paths:
- 'backend/**'
- '.github/workflows/backend*'
- 'docker-compose.yaml'
jobs:
backend-test:
name: Test Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push Elasticsearch image
uses: docker/build-push-action@v6
with:
context: .
file: DockerfileElastic
push: true
tags: ghcr.io/uudigitalhumanitieslab/ianalyzer-elastic:latest
cache-from: type=registry,ref=ghcr.io/uudigitalhumanitieslab/ianalyzer-elastic:latest
cache-to: type=inline
- name: Build and push Backend
uses: docker/build-push-action@v6
with:
context: backend/.
push: true
tags: ghcr.io/uudigitalhumanitieslab/ianalyzer-backend:latest
cache-from: type=registry,ref=ghcr.io/uudigitalhumanitieslab/ianalyzer-backend:latest
cache-to: type=inline
- name: Run backend tests
run: |
sudo mkdir -p /ci-data
docker compose pull elasticsearch
docker compose pull backend
docker compose --env-file .env-ci run --rm backend pytest