-
Notifications
You must be signed in to change notification settings - Fork 228
182 lines (154 loc) · 5.19 KB
/
pytest-core-nompi.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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
name: CI-core
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
# Trigger the workflow on push or pull request,
# but only for the master branch
push:
branches:
- master
pull_request:
branches:
- master
jobs:
pytest:
name: ${{ matrix.name }}-${{ matrix.set }}
runs-on: "${{ matrix.os }}"
env:
DEVITO_ARCH: "${{ matrix.arch }}"
DEVITO_LANGUAGE: ${{ matrix.language }}
OMP_NUM_THREADS: 2
strategy:
# Prevent all build to stop if a single one fails
fail-fast: false
matrix:
name: [
pytest-ubuntu-py311-gcc11-noomp,
pytest-ubuntu-py312-gcc12-omp,
pytest-ubuntu-py39-gcc7-omp,
pytest-ubuntu-py310-gcc10-noomp,
pytest-ubuntu-py312-gcc13-omp,
pytest-ubuntu-py39-gcc9-omp,
pytest-osx-py312-clang-omp,
pytest-docker-py39-gcc-omp,
pytest-docker-py39-icx-omp
]
set: [base, adjoint]
include:
- name: pytest-ubuntu-py311-gcc11-noomp
python-version: '3.11'
os: ubuntu-22.04
arch: "gcc-11"
language: "C"
sympy: "1.11"
- name: pytest-ubuntu-py312-gcc12-omp
python-version: '3.12'
os: ubuntu-24.04
arch: "gcc-12"
language: "openmp"
sympy: "1.13"
- name: pytest-ubuntu-py39-gcc7-omp
python-version: '3.9'
os: ubuntu-20.04
arch: "gcc-7"
language: "openmp"
sympy: "1.9"
- name: pytest-ubuntu-py310-gcc10-noomp
python-version: '3.10'
os: ubuntu-20.04
arch: "gcc-10"
language: "C"
sympy: "1.11"
- name: pytest-ubuntu-py312-gcc13-omp
python-version: '3.12'
os: ubuntu-24.04
arch: "gcc-13"
language: "openmp"
sympy: "1.13"
- name: pytest-ubuntu-py39-gcc9-omp
python-version: '3.9'
os: ubuntu-20.04
arch: "custom"
language: "openmp"
sympy: "1.10"
- name: pytest-osx-py312-clang-omp
python-version: '3.12'
os: macos-latest
arch: "clang"
language: "openmp"
sympy: "1.13"
- name: pytest-docker-py39-gcc-omp
python-version: '3.9'
os: ubuntu-latest
arch: "gcc"
language: "openmp"
sympy: "1.12"
- name: pytest-docker-py39-icx-omp
python-version: '3.9'
os: ubuntu-latest
arch: "icx"
language: "openmp"
sympy: "1.12"
- set: base
test-set: 'not adjoint'
- set: adjoint
test-set: 'adjoint'
exclude:
- name: pytest-osx-py312-clang-omp
set: adjoint
steps:
- name: Checkout devito
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
if: "!contains(matrix.name, 'docker')"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Build docker image
if: contains(matrix.name, 'docker')
run: |
docker build . --file docker/Dockerfile.devito --tag devito_img --build-arg base=devitocodes/bases:cpu-${{ matrix.arch }}
- name: Set run prefix
run: |
if [[ "${{ matrix.name }}" =~ "docker" ]]; then
echo "RUN_CMD=docker run --rm -t -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} --name testrun devito_img" >> $GITHUB_ENV
else
echo "RUN_CMD=" >> $GITHUB_ENV
fi
id: set-run
- name: Install ${{ matrix.arch }} compiler
if: "runner.os == 'linux' && !contains(matrix.name, 'docker') && matrix.arch !='custom' "
run : |
sudo apt-get install -y ${{ matrix.arch }}
- name: Set tests (reduced number for OSX)
run : |
if [ "${{ runner.os }}" == 'macOS' ]; then
brew install llvm libomp
echo "/opt/homebrew/bin:/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
fi
id: set-tests
- name: Set pip flags for latest python (3.12)
run: |
if [ "${{ matrix.python-version }}" == '3.12' ]; then
echo "PIPFLAGS='--break-system-packages'" >> $GITHUB_ENV
fi
- name: Install dependencies
if: "!contains(matrix.name, 'docker')"
run: |
python3 -m pip install ${{ env.PIPFLAGS }} --upgrade pip
python3 -m pip install ${{ env.PIPFLAGS }} sympy==${{matrix.sympy}}
python3 -m pip install ${{ env.PIPFLAGS }} -e .[tests,extras]
- name: Check configuration
run: |
${{ env.RUN_CMD }} python3 -c "from devito import configuration; print(''.join(['%s: %s \n' % (k, v) for (k, v) in configuration.items()]))"
- name: Test with pytest
run: |
${{ env.RUN_CMD }} pytest -k "${{ matrix.test-set }}" -m "not parallel" --cov --cov-config=.coveragerc --cov-report=xml ${{ env.TESTS }}
- name: Upload coverage to Codecov
if: "!contains(matrix.name, 'docker')"
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: ${{ matrix.name }}