-
-
Notifications
You must be signed in to change notification settings - Fork 58
60 lines (45 loc) · 1.49 KB
/
tests.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: CritiqueBrainz CI
on:
push:
branches: [ master ]
pull_request:
branches: [ '*' ]
jobs:
test:
name: Run test suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Create configuration file
run: cp custom_config.py.example custom_config.py
- name: Login to Docker Hub
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
continue-on-error: true
- name: Pull docker images
run: docker-compose -f docker/docker-compose.test.yml pull
- uses: satackey/[email protected]
continue-on-error: true
with:
key: critiquebrainz-prod-image-{hash}
restore-keys: |
critiquebrainz-prod-image-
- name: Run tests
run: ./test.sh
- name: Publish Test Results
uses: EnricoMi/[email protected]
if: ${{ always() }}
with:
files: reports/tests.xml
prod:
name: Build Production Image
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v2
- name: Login to Docker Hub
run: echo ${{ secrets.DOCKER_HUB_PASSWORD }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
continue-on-error: true
- uses: satackey/[email protected]
continue-on-error: true
- name: Build production image
run: docker build --build-arg GIT_COMMIT_SHA=HEAD .