-
Notifications
You must be signed in to change notification settings - Fork 54
208 lines (200 loc) · 6.89 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
204
205
206
207
208
name: CI
# Run on master, tags, or any pull request
on:
pull_request:
branches: "*"
push:
branches: master
tags: "*"
schedule:
- cron: "0 2 * * *" # Daily at 2 AM UTC (8 PM CST)
# Skip/cancel execution of queued/running jobs from outdated commits. Jobs run on the
# `master` branch are not subject to these restrictions and are always executed.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || github.run_number }}
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
env:
# Only download the tzdata version used in TimeZones.jl's tests to avoid unnecessary
# load on IANA's servers.
JULIA_TZ_VERSION: 2016j # Matches tzdata version used in tests
# The HEAD commit which triggered this workflow. By default PRs use a merge commit
SHA: ${{ github.event.pull_request.head.sha || github.sha }}
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
version:
- "1.6" # LTS / Oldest supported version
- "1" # Latest release
- nightly
# https://github.com/actions/runner-images#available-images
os:
- ubuntu-latest
- macos-14 # Apple silicon
- windows-latest
arch:
- x64
- x86
- aarch64
exclude:
# Test 32-bit only on Linux
- os: macos-14
arch: x86
- os: windows-latest
arch: x86
# Test ARM64 only on macOS
- os: ubuntu-latest
arch: aarch64
- os: windows-latest
arch: aarch64
# Prefer testing against Apple Silicon
- os: macos-14
arch: x64
- version: "1.6"
os: macos-14
arch: aarch64
# Disable Windows tests on Julia 1.6 as it's particularly slow
- version: "1.6"
os: windows-latest
include:
# Apple silicon isn't supported by Julia 1.6
- version: "1.6"
os: macos-13 # Intel
arch: x64
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:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
# https://pkgdocs.julialang.org/v1/creating-packages/#Transition-from-normal-dependency-to-extension
weakdeps:
name: Weakdeps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1.6" # LTS / Oldest support version
- uses: julia-actions/cache@v2
- shell: julia --color=yes --project=weakdeps {0}
run: |
using Pkg
Pkg.add(PackageSpec(name="TimeZones", rev=ENV["SHA"]))
using TimeZones
# TODO: Use shared project environments when the minimum version of Julia is 1.8 (e.g. `@sysimage`)
sysimage:
name: System Image - Julia ${{ matrix.version }} - TZJData ${{ matrix.tzjdata-version }} - ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- "1.6" # LTS / Oldest supported version
- "1" # Latest release
os:
- ubuntu-latest
tzjdata-version:
- "1.3.0" # Version which does not support `artifact_dir`
- "1"
env:
JULIA_DEPOT_PATH: build-depot
TZJDATA_VERSION: ${{ matrix.tzjdata-version }}
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
- name: Add TimeZones
shell: julia --color=yes --project=sysimage {0}
run: |
using Pkg
Pkg.add(PackageSpec(name="TZJData", version=ENV["TZJDATA_VERSION"]))
Pkg.add(PackageSpec(name="TimeZones", rev=ENV["SHA"]))
- name: Create sysimage
shell: julia --color=yes {0}
run: |
using Pkg
Pkg.add(PackageSpec(name="PackageCompiler", version="2"))
using PackageCompiler
create_sysimage(; project="sysimage", sysimage_path="sysimage.so")
# create_sysimage(; project=joinpath(first(DEPOT_PATH), "environments", "sysimage"), sysimage_path="sysimage.so")
- name: Validate sysimage works
shell: julia --color=yes --project=sysimage -Jsysimage.so {0}
run: |
using TimeZones
println(TimeZones._COMPILED_DIR[])
- name: Relocate Julia depot
run: mv build-depot sysimage-depot
- name: Validate sysimage works with relocated depot
shell: julia --color=yes --project=sysimage -Jsysimage.so {0}
run: |
using TimeZones
println(TimeZones._COMPILED_DIR[])
env:
JULIA_DEPOT_PATH: sysimage-depot
benchmarks:
name: Benchmarks
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1"
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- run: |
git fetch origin +:refs/remotes/origin/HEAD
julia --project=benchmark/ -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
julia --project=benchmark/ -e 'using PkgBenchmark, TimeZones; export_markdown(stdout, judge(TimeZones, "origin/HEAD", verbose=false))'
doctest:
name: Documentation - DocTests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1.9"
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- shell: julia --color=yes --project=docs {0}
run: |
using Pkg
Pkg.instantiate()
- run: julia --color=yes --project=docs docs/make.jl
env:
DOCTESTS: "true"
docs:
name: Documentation - Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: "1.9"
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- shell: julia --color=yes --project=docs {0}
run: |
using Pkg
Pkg.instantiate()
- run: julia --color=yes --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
DEPLOY_DOCS: "true"