-
Notifications
You must be signed in to change notification settings - Fork 219
132 lines (126 loc) · 4.59 KB
/
Tests.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
name: Tests
on:
push:
branches:
- master
pull_request:
# Cancel existing tests on the same PR if a new commit is added to a pull request
concurrency:
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
test:
# Use matrix.test.name here to avoid it taking up the entire window width
name: test ${{matrix.test.name}} (${{ matrix.runner.os }}, ${{ matrix.runner.version }}, ${{ matrix.runner.arch }}, ${{ matrix.runner.num_threads }})
runs-on: ${{ matrix.runner.os }}
continue-on-error: ${{ matrix.runner.version == 'pre' }}
strategy:
fail-fast: false
matrix:
test:
# Run some of the slower test files individually. The last one catches everything
# not included in the others.
- name: "essential/ad"
args: "essential/ad.jl"
- name: "mcmc/gibbs"
args: "mcmc/gibbs.jl"
- name: "mcmc/hmc"
args: "mcmc/hmc.jl"
- name: "mcmc/abstractmcmc"
args: "mcmc/abstractmcmc.jl"
- name: "mcmc/Inference"
args: "mcmc/Inference.jl"
- name: "experimental/gibbs"
args: "experimental/gibbs.jl"
- name: "mcmc/ess"
args: "mcmc/ess.jl"
- name: "everything else"
args: "--skip essential/ad.jl mcmc/gibbs.jl mcmc/hmc.jl mcmc/abstractmcmc.jl mcmc/Inference.jl experimental/gibbs.jl mcmc/ess.jl"
runner:
# Default
- version: '1'
os: ubuntu-latest
arch: x64
num_threads: 1
# x86
- version: '1'
os: ubuntu-latest
arch: x86
num_threads: 1
# Multithreaded
- version: '1'
os: ubuntu-latest
arch: x64
num_threads: 2
# Windows
- version: '1'
os: windows-latest
arch: x64
num_threads: 1
# macOS
- version: '1'
os: macos-latest
arch: aarch64
num_threads: 1
# Minimum supported Julia version
- version: 'min'
os: ubuntu-latest
arch: x64
num_threads: 1
# Minimum supported Julia version, multithreaded
- version: 'min'
os: ubuntu-latest
arch: x64
num_threads: 2
# Pre-release Julia version
- version: 'pre'
os: ubuntu-latest
arch: x64
num_threads: 1
steps:
- name: Print matrix variables
run: |
echo "OS: ${{ matrix.runner.os }}"
echo "Architecture: ${{ matrix.runner.arch }}"
echo "Julia version: ${{ matrix.runner.version }}"
echo "Number of threads: ${{ matrix.runner.num_threads }}"
echo "Test arguments: ${{ matrix.test.args }}"
- name: (De)activate coverage analysis
run: echo "COVERAGE=${{ matrix.runner.version == '1' && matrix.runner.os == 'ubuntu-latest' && matrix.runner.num_threads == 2 }}" >> "$GITHUB_ENV"
shell: bash
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '${{ matrix.runner.version }}'
arch: ${{ matrix.runner.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
# TODO: Use julia-actions/julia-runtest when test_args are supported
# Custom calls of Pkg.test tend to miss features such as e.g. adjustments for CompatHelper PRs
# Ref https://github.com/julia-actions/julia-runtest/pull/73
- name: Call Pkg.test
run: julia --color=yes --inline=yes --depwarn=yes --check-bounds=yes --threads=${{ matrix.runner.num_threads }} --project=@. -e 'import Pkg; Pkg.test(; coverage=parse(Bool, ENV["COVERAGE"]), test_args=ARGS)' -- ${{ matrix.test.args }}
- uses: julia-actions/julia-processcoverage@v1
if: ${{ env.COVERAGE }}
- uses: codecov/codecov-action@v4
if: ${{ env.COVERAGE }}
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
file: lcov.info
- uses: coverallsapp/github-action@v2
if: ${{ env.COVERAGE }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: lcov.info
flag-name: run-${{ join(matrix.*, '-') }}
parallel: true
finish:
needs: test
if: ${{ always() }}
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true