-
Notifications
You must be signed in to change notification settings - Fork 3
39 lines (32 loc) · 985 Bytes
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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/[email protected]
- name: Log in to Docker Hub
uses: docker/[email protected]
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/[email protected]
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