Merge pull request #1641 from UUDigitalHumanitieslab/dependabot/pip/b… #152
This file contains 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
# 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 |