forked from cpinte/mcfost
-
Notifications
You must be signed in to change notification settings - Fork 0
151 lines (125 loc) · 4.13 KB
/
test-suite.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
name: test-suite
on:
push:
branches: [ main ]
pull_request:
release:
types:
- published
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
env:
MCFOST_NO_XGBOOST: yes
MCFOST_GIT: "1"
SKIP_HDF5: no
jobs:
build-and-test:
strategy:
fail-fast: false
matrix:
os: [macos-arm, macos-intel, linux]
compiler: [gfortran, ifort]
openmp: [yes, no]
release: [yes, no]
include:
# Associate specific os versions with our os tags
- os: linux
os-version: ubuntu-22.04
- os: macos-intel
os-version: macos-13
- os: macos-arm
os-version: macos-14
# macos needs null container to avoid loading docker; set linux containers as desired
- container: null
- os: linux
compiler: gfortran
container: "quay.io/pypa/manylinux_2_28_x86_64"
exclude:
- os: macos-arm
compiler: ifort
- os: macos-intel
compiler: ifort # not compiling on macos13 for now
name: build+test (${{ matrix.os }}, ${{ matrix.compiler }}, openmp=${{ matrix.openmp }}, release=${{ matrix.release }})
runs-on: ${{ matrix.os-version }}
container: ${{ matrix.container }}
env:
SYSTEM: ${{ matrix.compiler }}
HDF5_DIR: /usr/local
MCFOST_INSTALL: /usr/local
OPENMP: ${{ matrix.openmp }}
steps:
- uses: actions/checkout@v4
- run: git config --global --add safe.directory $PWD
- name: build and install dependencies
uses: ./.github/actions/dependencies
- name: compile mcfost
working-directory: src
shell: bash -e {0}
run: |
[ ! "$SETVARS_COMPLETED" == 1 ] && test -f "$INTEL_PATH"/setvars.sh && . "$INTEL_PATH"/setvars.sh
make release=${{ matrix.release }} static=yes all
- name: test
uses: ./.github/actions/test
# Saving the binaries from the macos builds since the runner is the same for both compilers -> might be more consistent
# Only benchmark+release the 'release' builds, never the 'march=native' builds
- name: save binary for benchmarking and release
if: matrix.openmp == 'yes' && matrix.release == 'yes'
uses: actions/upload-artifact@v4
with:
name: mcfost-binary-${{ matrix.os }}-${{ matrix.compiler }}
path: src/mcfost
benchmark:
needs: build-and-test
strategy:
matrix:
compiler: [gfortran]
runs-on: macos-13
env:
SYSTEM: ${{ matrix.compiler }}
HDF5_DIR: /usr/local
MCFOST_INSTALL: /usr/local
OPENMP: yes
steps:
- uses: actions/checkout@v4
- name: restore binary artifact
uses: actions/download-artifact@v4
with:
name: mcfost-binary-macos-intel-${{ matrix.compiler }}
path: src/
- name: benchmark
uses: ./.github/actions/benchmark
- name: report benchmark results
run: |
echo ${{ matrix.compiler }} $(cat benchmark-${{ matrix.compiler }}.tim)
release:
needs: build-and-test
strategy:
matrix:
os: [linux, macos-intel, macos-arm]
include:
# Associate specific os versions with our os tags
- os: linux
os-version: ubuntu-22.04
- os: macos-intel
os-version: macos-13
- os: macos-arm
os-version: macos-14
runs-on: ${{ matrix.os-version }}
if: ${{ github.event_name == 'release' }}
steps:
- uses: actions/checkout@v4
- name: restore binary artifact
uses: actions/download-artifact@v4
with:
name: mcfost-binary-${{ matrix.os }}-${{ matrix.os == 'linux' && 'ifort' || 'gfortran' }} # use ifort for binary release
path: src/
- name: simple check to make sure the binary runs in a clean environment
shell: bash
working-directory: src
env:
MCFOST_UTILS: ${{ github.workspace }}/utils
run: |
chmod +x mcfost
./mcfost -h
- name: upload binary
uses: ./.github/actions/release