-
-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (62 loc) · 2.24 KB
/
docker_ci.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
61
62
63
64
65
name: docker CI
on:
push:
branches:
- "**"
pull_request:
branches:
- main
schedule:
- cron: "0 0 * * MON"
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
database-type: [PostgreSQL, SQLite3]
fail-fast: false
permissions:
contents: read
packages: write
defaults:
run:
working-directory: docker
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Create image
run: |
./create_image.sh
- name: Run tests with docker run
run: |
./run_tests.sh turing run ${{ matrix.database-type }}
./run_tests.sh mathrace_interaction/tests/unit run ${{ matrix.database-type }}
./run_tests.sh mathrace_interaction/tests/functional run ${{ matrix.database-type }}
./run_tests.sh mathrace_interaction/tests/integration run ${{ matrix.database-type }}
- name: Run tests with docker exec
if: matrix.database-type != 'SQLite3'
run: |
./create_volume.sh
./create_container.sh
./start_container.sh
./run_tests.sh turing exec ${{ matrix.database-type }}
./run_tests.sh mathrace_interaction/tests/unit exec ${{ matrix.database-type }}
./run_tests.sh mathrace_interaction/tests/functional exec ${{ matrix.database-type }}
./run_tests.sh mathrace_interaction/tests/integration exec ${{ matrix.database-type }}
./stop_container.sh
- name: Publish image to GitHub packages
if: matrix.database-type != 'SQLite3' && github.repository == 'dmf-unicatt/turing-dmf' && github.ref == 'refs/heads/main'
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
docker push ghcr.io/dmf-unicatt/turing-dmf:latest
warn:
runs-on: ubuntu-latest
if: github.repository == 'dmf-unicatt/turing-dmf' && github.ref == 'refs/heads/main' && github.event_name == 'schedule'
steps:
- name: Warn if scheduled workflow is about to be disabled
uses: fem-on-colab/warn-workflow-about-to-be-disabled-action@main
with:
workflow-filename: docker_ci.yml
days-elapsed: 50