Update Docker image version to 2.1.0 #16
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: Test and Build | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v2 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: . | |
| push: false | |
| tags: churchtools-api:latest | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| load: true | |
| - name: Run tests in Docker container | |
| run: | | |
| # Erstelle ein Volume für die Testberichte | |
| mkdir -p coverage | |
| # Führe die Tests im Docker-Container aus | |
| docker run --rm -v $(pwd)/coverage:/app/coverage churchtools-api:latest \ | |
| /bin/bash -c "pip install pytest pytest-asyncio pytest-cov && \ | |
| python -m pytest --cov=app tests/ --cov-report=xml --cov-report=term && \ | |
| cp coverage.xml /app/coverage/" | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./coverage/coverage.xml | |
| fail_ci_if_error: false |