-
Notifications
You must be signed in to change notification settings - Fork 194
84 lines (84 loc) · 3.01 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
name: CI
on:
push:
branches: [master]
tags: ["*"]
pull_request:
merge_group: # GitHub Merge Queue
jobs:
finalize:
timeout-minutes: 10
needs: [test, docs]
if: always() # Important: Make sure that this job runs even if the tests fail.
runs-on: ubuntu-latest # GitHub-hosted runners
steps:
- run: |
echo test: ${{ needs.test.result }}
echo docs: ${{ needs.docs.result }}
- run: exit 1
# Every line except the last line must end with `||`.
# The last line must NOT end with `||`.
if: |
(needs.test.result != 'success') ||
(needs.docs.result != 'success')
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0'
- '1' # automatically expands to the latest stable 1.x release of Julia
os:
- ubuntu-latest
- macOS-latest
- windows-latest
arch:
- x64
- x86
exclude:
- os: macOS-latest
arch: x86
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
# This is a public repo.
# We are using v4 of the codecov-action.
# If the PR is from a fork, then Codecov allows us to use
# tokenless Codecov uploads.
# If the PR is not from a fork, then Codecov does not allow
# us to use tokenless Codecov uploads, and thus we must use
# the token.
# Tokenless Codcov uploads are prone to random failures,
# due to Codecov's servers hitting GitHub rate limits.
# Therefore:
# 1. If this CI run is not a PR run, we set `fail_ci_if_error` to `true`.
# 2. If this CI run is a PR run and the PR is not from a fork, we set `fail_ci_if_error` to `true`.
# 3. If this CI run is a PR run and the PR is from a fork, we set `fail_ci_if_error` to `false`.
fail_ci_if_error: ${{ (github.event_name != 'pull_request') || (github.repository == github.event.pull_request.head.repo.full_name) }}
token: ${{ secrets.CODECOV_TOKEN }}
docs:
permissions:
contents: write
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: nightly # needed until https://github.com/JuliaLang/julia/issues/49620 is in a release
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-docdeploy@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}