-
Notifications
You must be signed in to change notification settings - Fork 0
209 lines (181 loc) · 6.22 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
209
name: CI
on:
merge_group:
pull_request:
push:
branches:
- main
tags:
- "*"
concurrency:
# Skip intermediate builds: all builds except for builds on the `master` branch
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/main' || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
permissions:
actions: write
contents: read
jobs:
finalize:
timeout-minutes: 10
needs: [test-bundle, test-multiversion]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
echo test-multiversion: ${{ needs.test-multiversion.result }}
echo test-bundle: ${{ needs.test-bundle.result }}
- run: exit 1
if: |
(needs.test-multiversion.result != 'success') ||
(needs.test-bundle.result != 'success')
build-multiversion:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
with:
persist-credentials: false
- uses: julia-actions/install-juliaup@5e96cfab3bb0500aa42f2843f46c24b91cfcc3cd
with:
julia-version: "1.10.2"
- run: juliaup default 1.10.2
- run: julia --project -e 'import Pkg; Pkg.instantiate()'
- run: julia --project -e 'import PackageBundler; PackageBundler.instantiate("test/multiversion/envs")'
- run: julia --project test/multiversion/bundle.jl
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: multiversion
path: test/multiversion/build/CommonMarkStrippedRegistry
test-multiversion:
needs: [build-multiversion]
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
version:
- "1.10.1"
- "1.10.2"
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874
with:
version: ${{ matrix.version }}
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
name: multiversion
path: multiversion
- name: Initialize Julia Depot
run: julia -e 'import Pkg; Pkg.status()'
- name: Install bundle
run: julia multiversion/registry/install.jl
- name: Installing the same bundle again should uninstall and reinstall
run: julia multiversion/registry/install.jl
- name: Resolve environment and precompile
run: |
julia --project=@CommonMark_${{ matrix.version }} -e '
pushfirst!(LOAD_PATH, "@stdlib")
import Pkg
Pkg.status()
Pkg.resolve()
Pkg.precompile("CommonMark")
'
- name: Load stripped package and check for source stripping
run: julia --project=@CommonMark_${{ matrix.version }} -e 'import CommonMark; @show(first(functionloc(CommonMark.issafe, Tuple{Char}))) === nothing || exit(1)'
- name: Remove bundle
run: |
julia -e '
for depot in DEPOT_PATH
path = joinpath(depot, "registries", "CommonMarkStrippedRegistry", "remove.jl")
if isfile(path)
run(`julia $path`)
break
end
end
'
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version:
- "1.10.2"
os:
- macos-latest
- ubuntu-latest
- windows-latest
steps:
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633
with:
persist-credentials: false
- uses: julia-actions/install-juliaup@5e96cfab3bb0500aa42f2843f46c24b91cfcc3cd
with:
julia-version: "${{ matrix.version }}"
- run: juliaup default ${{ matrix.version }}
- uses: julia-actions/cache@dc1a3cdeacb521b0ca93cfc66143fcadb15a5bd0
- uses: julia-actions/julia-buildpkg@90dd6f23eb49626e4e6612cb9d64d456f86e6a1c
- run: julia --project -e 'import PackageBundler; PackageBundler.instantiate("test/envs")'
- uses: julia-actions/julia-runtest@79a7e100883947123f8263c5f06e6c0ea3eb972f
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
with:
name: bundle-${{ matrix.os }}
path: test/build/LocalCustomRegistry
test-bundle:
needs: [test]
runs-on: ${{ matrix.os }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
version:
- "1.10.2"
os:
- macos-latest
- ubuntu-latest
- windows-latest
bundle:
- bundle-macos-latest
- bundle-ubuntu-latest
- bundle-windows-latest
steps:
- uses: julia-actions/setup-julia@f2258781c657ad9b4b88072c5eeaf9ec8c370874
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@dc1a3cdeacb521b0ca93cfc66143fcadb15a5bd0
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427
with:
name: ${{ matrix.bundle }}
path: ${{ matrix.bundle }}
- name: Initialize Julia Depot
run: julia -e 'import Pkg; Pkg.status()'
- name: Install bundle
run: julia ${{ matrix.bundle }}/registry/install.jl
- name: Installing the same bundle again should uninstall and reinstall
run: julia ${{ matrix.bundle }}/registry/install.jl
- name: Resolve environment and precompile
run: |
julia --project=@CustomEnv -e '
pushfirst!(LOAD_PATH, "@stdlib")
import Pkg
Pkg.status()
Pkg.resolve()
Pkg.precompile("CairoMakie")
'
- name: Load packages
run: julia --project=@CustomEnv -e 'import CairoMakie'
- name: Remove bundle
run: |
julia -e '
for depot in DEPOT_PATH
path = joinpath(depot, "registries", "LocalCustomRegistry", "remove.jl")
if isfile(path)
run(`julia $path`)
break
end
end
'