Bump pytest from 5.3.5 to 9.0.3 #4
Workflow file for this run
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: Docker image CI | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - Dockerfile | |
| - requirements.txt | |
| - Pipfile | |
| - Pipfile.lock | |
| - .github/workflows/docker-image.yml | |
| pull_request: | |
| paths: | |
| - Dockerfile | |
| - requirements.txt | |
| - Pipfile | |
| - Pipfile.lock | |
| - .github/workflows/docker-image.yml | |
| concurrency: | |
| group: docker-image-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| IMAGE_NAME: ghcr.io/${{ github.repository }} | |
| jobs: | |
| build-test-push: | |
| name: Build, test and publish docker image | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build image for tests | |
| run: | | |
| docker buildx build \ | |
| --load \ | |
| --cache-from type=gha \ | |
| --cache-to type=gha,mode=max \ | |
| --tag local-ci-image:${{ github.sha }} \ | |
| . | |
| - name: Run tests inside built image | |
| run: | | |
| docker run --rm \ | |
| -v "${{ github.workspace }}:/app" \ | |
| -w /app \ | |
| local-ci-image:${{ github.sha }} \ | |
| pytest src/test/test_api.py | |
| - name: Log in to GitHub Container Registry | |
| if: github.event_name == 'push' | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Extract image metadata | |
| if: github.event_name == 'push' | |
| id: meta | |
| uses: docker/metadata-action@v5 | |
| with: | |
| images: ${{ env.IMAGE_NAME }} | |
| tags: | | |
| type=raw,value=latest | |
| type=sha,prefix=sha- | |
| type=raw,value=run-${{ github.run_number }} | |
| - name: Build and push image | |
| if: github.event_name == 'push' | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: true | |
| tags: ${{ steps.meta.outputs.tags }} | |
| labels: ${{ steps.meta.outputs.labels }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |