-
Notifications
You must be signed in to change notification settings - Fork 46
183 lines (174 loc) · 6.17 KB
/
test.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
name: proj ci
on:
push:
branches:
- main
- staging
- trying
pull_request:
merge_group:
env:
LIBPROJ_VERSION: 9.4.0
RUST_MSRV: "1.70"
RUST_LATEST: "1.77"
jobs:
# work around GHA env strictness
compute:
runs-on: ubuntu-latest
outputs:
RUST_MSRV: ${{ env.RUST_MSRV }}
RUST_LATEST: ${{ env.RUST_LATEST }}
LIBPROJ_VERSION: ${{ env.LIBPROJ_VERSION }}
steps:
- name: Compute outputs
run: |
echo "RUST_MSRV=${{ env.RUST_MSRV }}" >> $GITHUB_OUTPUT
echo "RUST_LATEST=${{ env.RUST_LATEST }}" >> $GITHUB_OUTPUT
echo "LIBPROJ_VERSION=${{ env.LIBPROJ_VERSION }}" >> $GITHUB_OUTPUT
# The `ci-result` job doesn't actually test anything - it just aggregates the
# overall build status, otherwise the merge queue would need an entry
# for each individual job produced by the job-matrix.
#
# Ref: https://github.com/rust-lang/crater/blob/9ab6f9697c901c4a44025cf0a39b73ad5b37d198/.github/workflows/bors.yml#L125-L149
#
# ALL THE SUBSEQUENT JOBS NEED THEIR key ADDED TO THE `needs` SECTION OF THIS JOB!
ci-success:
name: ci result
runs-on: ubuntu-latest
if: ${{ success() }}
needs:
- proj-ubuntu
- proj-sys-ubuntu
- proj-macos
- proj-sys-macos
steps:
- name: Mark the job as a success
run: exit 0
ci-failure:
name: ci result
runs-on: ubuntu-latest
if: ${{ failure() }}
needs:
- proj-ubuntu
- proj-sys-ubuntu
- proj-macos
- proj-sys-macos
steps:
- name: Mark the job as a failure
run: exit 1
proj-ubuntu:
name: proj ubuntu
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
needs: compute
strategy:
fail-fast: false
matrix:
container_image:
# Minimum supported rust (MSRV)
- ghcr.io/georust/proj-ci:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_MSRV }}
# Latest stable rust
- ghcr.io/georust/proj-ci:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_LATEST }}
features:
- ""
- "--features network"
- "--features bundled_proj"
- "--no-default-features"
- "--features \"network bundled_proj\""
- "--features \"network geo-types\""
- "--features \"bundled_proj geo-types\""
- "--features \"network bundled_proj geo-types\""
container:
image: ${{ matrix.container_image }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: cargo build ${{ matrix.features }}
- run: cargo test ${{ matrix.features }}
proj-macos:
name: proj macos
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
features: ["", "--features network"]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: cargo build ${{ matrix.features }}
- run: cargo test ${{ matrix.features }}
proj-sys-ubuntu:
name: proj-sys ubuntu
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
needs: compute
defaults:
run:
working-directory: proj-sys
container: ${{ matrix.container }}
strategy:
matrix:
include:
# Minimum supported rust (MSRV)
- container:
image: ghcr.io/georust/proj-ci:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_MSRV }}
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 0
features: ""
- container:
image: ghcr.io/georust/proj-ci:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_MSRV }}
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 1
features: "--features bundled_proj"
- container:
image: ghcr.io/georust/proj-ci-without-system-proj:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_MSRV }}
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 1
features: ""
# Latest stable rust
- container:
image: ghcr.io/georust/proj-ci:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_LATEST }}
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 0
features: ""
- container:
image: ghcr.io/georust/proj-ci:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_LATEST }}
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 1
features: "--features bundled_proj"
- container:
image: ghcr.io/georust/proj-ci-without-system-proj:proj-${{ needs.compute.outputs.LIBPROJ_VERSION }}-rust-${{ needs.compute.outputs.RUST_LATEST }}
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 1
features: ""
steps:
- name: Checkout repository
uses: actions/checkout@v4
- run: cargo build ${{ matrix.features }}
- run: cargo test ${{ matrix.features }}
proj-sys-macos:
name: proj-sys macos
if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: macos-latest
env:
_PROJ_SYS_TEST_EXPECT_BUILD_FROM_SRC: 0
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: TRUE
defaults:
run:
working-directory: proj-sys
steps:
- name: Checkout repository
uses: actions/checkout@v4
# At some point around Feb. 2023, the GH macos CI runner no longer had
# pkg-config installed by default, so we need to install it manually.
#
# This PR (merged a couple days ago) adds pkg-config back to the macos
# build: https://github.com/actions/runner-images/pull/7125
#
# but it seems like it hasn't been deployed yet. At some point we should
# be able to delete this step if CI passes.
- run: brew update
- run: brew install pkg-config
- run: brew install proj
- run: cargo test