-
Notifications
You must be signed in to change notification settings - Fork 6
203 lines (199 loc) · 7.91 KB
/
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
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
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: CI
on:
push:
branches:
- main
paths-ignore:
- 'LICENSE.md'
- 'README.md'
- '.github/workflows/CompatHelper.yml'
- '.github/workflows/DocPreviewCleanup.yml'
- '.github/workflows/TagBot.yml'
pull_request:
paths-ignore:
- 'LICENSE.md'
- 'README.md'
- '.github/workflows/CompatHelper.yml'
- '.github/workflows/DocPreviewCleanup.yml'
- '.github/workflows/TagBot.yml'
workflow_dispatch:
# Cancel redundant CI tests automatically
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
name: ${{ matrix.os }} - ${{ matrix.JULIA_P4EST_TEST }} - Julia ${{ matrix.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
# - 'nightly'
os:
- ubuntu-latest
- macos-latest
- windows-latest
arch:
- x64
JULIA_P4EST_TEST:
- P4EST_JLL_MPI_DEFAULT
- P4EST_CUSTOM_MPI_CUSTOM
exclude:
# Some preferences are not loaded in package tests in older versions
# of Julia, see
# https://github.com/JuliaPackaging/Preferences.jl/issues/40
# Thus, we need to disable this setup in CI.
- version: '1.6'
JULIA_P4EST_TEST: P4EST_CUSTOM_MPI_CUSTOM
# Run only selected tests on macOS and Windows, since not everything
# works everywhere yet and we are most familiar with setting up custom
# p4est and MPI builds on Linux.
- os: macos-latest
JULIA_P4EST_TEST: P4EST_CUSTOM_MPI_CUSTOM
- os: windows-latest
JULIA_P4EST_TEST: P4EST_CUSTOM_MPI_CUSTOM
steps:
- uses: actions/checkout@v4
- name: Set p4est release to run tests against
# We use an older release of `p4est` on purpose than the version
# provided by P4est_jll.jl to check whether everything still works
# in another version of `p4est` than the version used to generate the
# bindings.
run: |
P4EST_RELEASE=2.3.1
echo "P4EST_RELEASE=$P4EST_RELEASE" >> $GITHUB_ENV
echo "P4EST_RELEASE=$P4EST_RELEASE"
shell: bash
- name: Set environment variables
run: |
echo "Setting variables for '${{ matrix.JULIA_P4EST_TEST }}'..."
echo "JULIA_P4EST_TEST=${{ matrix.JULIA_P4EST_TEST }}" >> $GITHUB_ENV
echo "JULIA_P4EST_TEST=${{ matrix.JULIA_P4EST_TEST }}"
if [[ ${{ matrix.JULIA_P4EST_TEST }} == "P4EST_JLL_MPI_DEFAULT" ]]
then
echo "(no additional environment variables required)"
elif [[ ${{ matrix.JULIA_P4EST_TEST }} == "P4EST_CUSTOM_MPI_CUSTOM" ]]
then
P4EST_TMP=`pwd`/libp4est_tmp
echo "P4EST_TMP=$P4EST_TMP" >> $GITHUB_ENV
echo "P4EST_TMP=$P4EST_TMP"
echo "JULIA_P4EST_TEST_LIBP4EST=$P4EST_TMP/prefix/lib/libp4est.so" >> $GITHUB_ENV
echo "$JULIA_P4EST_TEST_LIBP4EST=$P4EST_TMP/prefix/lib/libp4est.so"
echo "JULIA_P4EST_TEST_LIBSC=$P4EST_TMP/prefix/lib/libsc.so" >> $GITHUB_ENV
echo "$JULIA_P4EST_TEST_LIBSC=$P4EST_TMP/prefix/lib/libsc.so"
else
echo "ERROR: unknown test type ${{ matrix.JULIA_P4EST_TEST }}" >&2
exit 1
fi
echo "Done."
shell: bash
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
show-versioninfo: true
- uses: julia-actions/cache@v2
- name: Install custom MPI library for testing
run: |
if [[ ${{ matrix.JULIA_P4EST_TEST }} == "P4EST_CUSTOM_MPI_CUSTOM" ]]
then
sudo apt-get install -y openmpi-bin libopenmpi-dev
fi
shell: bash
- name: Install custom p4est library for testing
run: |
./.ci_install_p4est.sh
shell: bash
- name: Configure MPI.jl
shell: julia --color=yes {0}
run: |
@show pwd()
include(joinpath(pwd(), "test", "configure_packages.jl"))
- uses: julia-actions/julia-buildpkg@v1
env:
PYTHON: ""
- uses: julia-actions/julia-runtest@v1
env:
PYTHON: ""
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./lcov.info # optional
flags: unittests # optional
name: codecov-umbrella # optional
fail_ci_if_error: true # optional (default = false)
# verbose: true # optional (default = false)
# The standard setup of Coveralls is just annoying for parallel builds, see, e.g.,
# https://github.com/trixi-framework/Trixi.jl/issues/691
# https://github.com/coverallsapp/github-action/issues/47
# https://github.com/coverallsapp/github-action/issues/67
# This standard setup is reproduced below for completeness.
# - uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# flag-name: run-${{ matrix.JULIA_P4EST_TEST }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}-${{ github.run_id }}
# parallel: true
# path-to-lcov: ./lcov.info
# Instead, we use a more tedious approach:
# - Store all individual coverage files as artifacts (directly below)
# - Download and merge individual coverage reports in another step
# - Upload only the merged coverage report to Coveralls
- shell: bash
run: |
cp ./lcov.info ./lcov-${{ matrix.JULIA_P4EST_TEST }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}.info
- uses: actions/upload-artifact@v4
with:
name: lcov-${{ matrix.JULIA_P4EST_TEST }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}
path: ./lcov-${{ matrix.JULIA_P4EST_TEST }}-${{ matrix.os }}-${{ matrix.version }}-${{ matrix.arch }}.info
finish:
needs: test
runs-on: ubuntu-latest
steps:
# The standard setup of Coveralls is just annoying for parallel builds, see, e.g.,
# https://github.com/trixi-framework/Trixi.jl/issues/691
# https://github.com/coverallsapp/github-action/issues/47
# https://github.com/coverallsapp/github-action/issues/67
# This standard setup is reproduced below for completeness.
# - name: Coveralls Finished
# uses: coverallsapp/github-action@master
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# parallel-finished: true
# Instead, we use the more tedious approach described above.
# At first, we check out the repository and download all artifacts
# (and list files for debugging).
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- run: ls -R
# Next, we merge the individual coverage files and upload
# the combined results to Coveralls.
- name: Merge lcov files using Coverage.jl
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.activate(temp=true)
Pkg.add("Coverage")
using Coverage
coverage = LCOV.readfolder(".")
for cov in coverage
cov.filename = replace(cov.filename, "\\" => "/")
end
coverage = merge_coverage_counts(coverage)
@show covered_lines, total_lines = get_summary(coverage)
LCOV.writefile("./lcov.info", coverage)
- uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./lcov.info
# Upload merged coverage data as artifact for debugging
- uses: actions/upload-artifact@v4
with:
name: lcov
path: ./lcov.info
# That's it
- run: echo "Finished testing P4est"