Fixing comparison #82
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
name: Backend - Run Tests | |
on: | |
workflow_dispatch: | |
push: | |
paths: | |
- 'backend/**' | |
- '.github/workflows/ci-backend.yaml' | |
- '.github/workflows/run-tests.yaml' | |
jobs: | |
test-backend: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v1 | |
- id: lowercase-repo-name | |
uses: ASzc/change-string-case-action@v5 | |
with: | |
string: ${{ github.repository }} | |
- name: Build and Push Docker Image | |
uses: docker/build-push-action@v2 | |
with: | |
context: "./backend" | |
target: test | |
load: true | |
tags: ghcr.io/${{ steps.lowercase-repo-name.outputs.lowercase }}-backend:latest | |
- name: Run Tests | |
run: | | |
mkdir -p $GITHUB_WORKSPACE/cov | |
sudo chown -R 1000:1000 $GITHUB_WORKSPACE/cov | |
sudo chmod g+s $GITHUB_WORKSPACE/cov | |
docker compose run \ | |
--volume $GITHUB_WORKSPACE/cov:/cov \ | |
-u 1000 \ | |
backend sh -c \ | |
"coverage run --data-file=/cov/.coverage -m pytest tests/ && coverage xml --data-file=/cov/.coverage -o /cov/coverage.xml" | |
env: | |
REPO_NAME: ${{ steps.lowercase-repo-name.outputs.lowercase }} |