-
Notifications
You must be signed in to change notification settings - Fork 5
124 lines (124 loc) · 4.05 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
name: CI
on:
merge_group: # GitHub Merge Queue
pull_request:
push:
branches:
- master
tags: '*'
defaults:
run:
shell: bash
concurrency:
# Skip intermediate builds: all builds except for builds on the `master` or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
finalize:
needs: [format, test, docs]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
echo format: ${{ needs.format.result }}
echo test: ${{ needs.test.result }}
echo docs: ${{ needs.docs.result }}
- run: exit 1
# Make sure that every line (except for the last line) ends in `||`.
# Make sure that the last line does NOT end in `||`.
if: |
(needs.format.result != 'success') ||
(needs.test.result != 'success') ||
(needs.docs.result != 'success')
format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: 1
- name: Install and run JuliaFormatter
run: make format-fix
- uses: reviewdog/action-suggester@v1
with:
tool_name: JuliaFormatter
fail_on_error: true
filter_mode: added
test:
needs: format
name: Julia ${{ matrix.version }} / generate=${{ matrix.generate }} / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ github.event_name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
generate:
- 'false'
- 'true'
version:
- '1.4'
- '1'
- 'nightly'
os:
- ubuntu-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- if: ${{ matrix.generate == 'true' }}
run: |
rm -rf src/autogenerated/*
rm -rf ~/.julia
julia --project=.ci/generate .ci/generate/develop.jl
julia --project=.ci/generate .ci/generate/generate.jl
- run: rm -rf ~/.julia
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- run: rm -rf src/autogenerated/*
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}
file: lcov.info
docs:
needs: format
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- run: julia --color=yes -e 'import Pkg; VERSION >= v"1.5-" && !isdir(joinpath(DEPOT_PATH[1], "registries", "General")) && Pkg.Registry.add("General")'
shell: bash
env:
# We set `JULIA_PKG_SERVER` only for this step to enforce
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
# the request metadata to pkg.julialang.org when installing
# packages via `Pkg.test`.
JULIA_PKG_SERVER: ""
- run: julia --project=docs docs/develop.jl
- run: |
julia --project=docs -e '
import Documenter
import FHIRClient
import Generate
Documenter.doctest(FHIRClient)'
- run: |
julia --project=docs -e '
import Documenter
import FHIRClient
import Generate
Documenter.doctest(Generate; manual = joinpath(pwd(), "docs", "src"))'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}