Skip to content

Commit

Permalink
Add pytest GHA
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark-Powers committed Sep 30, 2024
1 parent 69e6a80 commit eab1f86
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Run Tests

on:
workflow_run:
workflows: ["CI"]
types:
- completed

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
test:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: latest=${{ env.BRANCH == 'master' }}

- name: Pull Docker image
run: docker pull ${{ steps.meta.outputs.tags }}

- name: Run tests
run: docker run --rm ${{ steps.meta.outputs.tags }} ./manage.py test

0 comments on commit eab1f86

Please sign in to comment.