-
Notifications
You must be signed in to change notification settings - Fork 59
107 lines (98 loc) · 3.39 KB
/
CI.yml
File metadata and controls
107 lines (98 loc) · 3.39 KB
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
name: CI
on:
push:
branches:
- 'main'
- 'release-'
tags: '*'
paths-ignore:
- 'docs/**'
pull_request:
types: [opened, synchronize, reopened, ready_for_review, converted_to_draft]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
# Cancel intermediate builds: only if it is a pull request build.
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
groups: ${{ steps.mk.outputs.groups }}
version: ${{ steps.mk.outputs.version }}
os: ${{ steps.mk.outputs.os }}
steps:
- uses: actions/checkout@v6
- id: mk
shell: bash
run: |
# Auto-discover test groups from all subdirectory names.
groups=$(find test -mindepth 1 -maxdepth 1 -type d \
| xargs -I{} basename {} | sort \
| jq -R -s -c '[split("\n")[] | select(length > 0)]')
echo "groups=${groups}" >> "$GITHUB_OUTPUT"
# Draft PR: only run ubuntu-latest + version=1
if [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.draft }}" == "true" ]]; then
echo 'version=["1"]' >> "$GITHUB_OUTPUT"
echo 'os=["ubuntu-latest"]' >> "$GITHUB_OUTPUT"
else
echo 'version=["lts","1"]' >> "$GITHUB_OUTPUT"
echo 'os=["ubuntu-latest","macOS-latest","windows-latest"]' >> "$GITHUB_OUTPUT"
fi
test:
name: "Tests (${{ matrix.group }}, ${{ matrix.os }}, Julia ${{ matrix.version }})"
needs: setup-matrix
strategy:
fail-fast: false
matrix:
version: ${{ fromJSON(needs.setup-matrix.outputs.version) }}
os: ${{ fromJSON(needs.setup-matrix.outputs.os) }}
group: ${{ fromJSON(needs.setup-matrix.outputs.groups) }}
runs-on: ${{ matrix.os }}
timeout-minutes: 120
steps:
- uses: actions/checkout@v6
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v3
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
with:
test_args: '${{ matrix.group }}${{ github.event.pull_request.draft == true && '' --fast'' || '''' }}'
env:
JULIA_NUM_THREADS: "4"
- uses: julia-actions/julia-processcoverage@v1
with:
directories: 'src,ext'
- uses: codecov/codecov-action@v6
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
# test-nightly:
# name: "Tests (${{ matrix.group }}, ${{ matrix.os }}, Julia nightly)"
# needs: [setup-matrix, test]
# if: github.event.pull_request.draft != true
# strategy:
# fail-fast: false
# matrix:
# version:
# - 'nightly'
# group: ${{ fromJSON(needs.setup-matrix.outputs.groups) }}
# os:
# - ubuntu-latest
# - macOS-latest
# - windows-latest
# runs-on: ${{ matrix.os }}
# timeout-minutes: 120
# steps:
# - uses: actions/checkout@v6
# - uses: julia-actions/setup-julia@v2
# with:
# version: ${{ matrix.version }}
# - uses: julia-actions/cache@v3
# - uses: julia-actions/julia-buildpkg@v1
# - uses: julia-actions/julia-runtest@v1
# with:
# test_args: '${{ matrix.group }}'