-
Notifications
You must be signed in to change notification settings - Fork 249
90 lines (75 loc) · 2 KB
/
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
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: test
on:
push:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
branches: [ master ]
paths-ignore:
- 'docs/**'
- 'README.md'
env:
OMP_STACKSIZE: 512M
OMP_NUM_THREADS: 4
jobs:
test:
strategy:
fail-fast: false
matrix:
system:
- gfortran
- ifort
debug:
- no
- yes
input: # [SETUP, phantom_tests]
- ['test', '']
- ['testkd', '']
- ['testdust', 'dust']
- ['testgr', 'gr']
- ['testgrav', 'gravity ptmass setstar']
- ['testgrowth', 'dustgrowth']
- ['testnimhd', 'nimhd']
- ['test2', '']
- ['testcyl', '']
name: |
test (SYSTEM=${{ matrix.system }},
DEBUG=${{ matrix.debug }},
SETUP=${{ matrix.input[0] }},
targets=${{ matrix.input[1] }})
runs-on: ubuntu-latest
steps:
- name: "Nuke the github workspace before doing anything"
run: rm -r ${{ github.workspace }} && mkdir ${{ github.workspace }}
- name: Setup Intel repo
if: matrix.system == 'ifort'
uses: fortran-lang/setup-fortran@v1
with:
compiler: intel-classic
- name: "Clone phantom"
uses: actions/checkout@v4
- name: "Compile phantom"
run: make SETUP=${{ matrix.input[0] }} DEBUG=${{ matrix.debug }} phantomtest
env:
SYSTEM: ${{ matrix.system }}
- name: "Run phantom tests"
run: ./bin/phantomtest ${{ matrix.input[1] }}
# Gather results into a dummy job that will fail if the previous job fails
gather_results:
if: always()
needs:
- test
# This name matches the branch protection requirement
name: test
runs-on: ubuntu-latest
steps:
- name: Check all tests
run: |
if [[ "${{ needs.test.result }}" == "success" ]]; then
echo "All tests succeeded"
else
echo "At least one test failed"
exit 1
fi