-
Notifications
You must be signed in to change notification settings - Fork 550
221 lines (185 loc) · 7.76 KB
/
binaries.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
210
211
212
213
214
215
216
217
218
219
220
221
name: Passenger generic binaries CI
env:
ENTERPRISE: 0
FORCE_COLOR: 1
RUST_LOG_STYLE: always
on:
push: {}
pull_request: {}
jobs:
build_linux:
name: Binaries Linux ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- runner: ubuntu-24.04
arch: x86_64
docker_arch: amd64
- runner: passenger-ubuntu-24.04-arm64-4cpu
arch: aarch64
docker_arch: arm64
runs-on: ${{ matrix.runner }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- run: mkdir cache output
working-directory: packaging/binaries/linux
- name: Fetch cache
run: ./dev/ci/fetch-cache-az-blob-storage
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
BLOB_NAME: "binaries/linux-binaries-cache-${{ hashFiles('packaging/binaries/linux/docker_image/Dockerfile') }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd"
CACHE_PATH: packaging/binaries/linux/cache
- name: Build
run: >
./build
-p "$WORKSPACE"
-c cache
-o output
-A "$DOCKER_ARCH"
-j 2
passenger nginx
env:
WORKSPACE: ${{ github.workspace }}
DOCKER_ARCH: ${{ matrix.docker_arch }}
working-directory: packaging/binaries/linux
- uses: actions/upload-artifact@v4
with:
name: binaries-linux-${{ matrix.arch }}
path: packages/binaries/linux/output/**/*
- name: Update cache
run: ./dev/ci/update-cache-az-blob-storage
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
BLOB_NAME: "binaries/linux-binaries-cache-${{ hashFiles('packaging/binaries/linux/docker_image/Dockerfile') }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd"
CACHE_PATH: packaging/binaries/linux/cache
if: always()
- name: Package
run: ./package -i output -o output -a "$ARCHITECTURE"
env:
ARCHITECTURE: ${{ matrix.arch }}
working-directory: packaging/binaries/linux
- name: Test
run: >
./test
-p "$WORKSPACE"
-i output
-I output
-A "$DOCKER_ARCH"
env:
WORKSPACE: ${{ github.workspace }}
DOCKER_ARCH: ${{ matrix.docker_arch }}
working-directory: packaging/binaries/linux
build_macos:
name: Binaries macOS ${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include:
- runner: macos-13
arch: x86_64
sccache_arch_and_os: x86_64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-13-x86_64
- runner: macos-14
arch: arm64
sccache_arch_and_os: aarch64-apple-darwin
sccache_azure_key_prefix: sccache/cxx-macos-14-arm
runs-on: ${{ matrix.runner }}
env:
CONTAINER_NAME: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_BLOB_CONTAINER: ${{ vars.SCCACHE_AZURE_BLOB_CONTAINER }}
SCCACHE_AZURE_KEY_PREFIX: ${{ matrix.sccache_azure_key_prefix }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Install dependencies
run: brew install zlib automake libtool coreutils
- run: mkdir work runtime-output output
working-directory: packaging/binaries/macos
- name: Determine runtime version
id: determine_runtime_version
run: |
RUNTIME_VERSION=$(cat ../shared/definitions/macos_runtime_version)
echo "version=$RUNTIME_VERSION" >> "$GITHUB_OUTPUT"
working-directory: packaging/binaries/macos
- name: Fetch RVM cache
run: CACHE_PATH="$HOME/.rvm" ./dev/ci/fetch-cache-az-blob-storage
id: fetch_rvm_cache
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
BLOB_NAME: "binaries/rvm-${{ hashFiles('packaging/binaries/shared/definitions/ruby_versions') }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd"
- name: Install RVM
run: set -o pipefail && curl -fsSL https://get.rvm.io/stable | bash
- name: Install Rubies
run: xargs -I{} "$HOME/.rvm/bin/rvm" install ruby-{} < packaging/binaries/shared/definitions/ruby_versions
if: steps.fetch_rvm_cache.outputs.cache-hit != 'true'
- name: Cleanup RVM
run: ~/.rvm/bin/rvm cleanup all
if: steps.fetch_rvm_cache.outputs.cache-hit != 'true'
- name: Update RVM cache
run: CACHE_PATH="$HOME/.rvm" ./dev/ci/update-cache-az-blob-storage
if: steps.fetch_rvm_cache.outputs.cache-hit != 'true'
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
BLOB_NAME: "binaries/rvm-${{ hashFiles('packaging/binaries/shared/definitions/ruby_versions') }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd"
- name: Setup sccache
run: ./dev/ci/setup-sccache
timeout-minutes: 1
env:
ARCH_AND_OS: ${{ matrix.sccache_arch_and_os }}
SCCACHE_AZURE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
- name: Fetch runtime cache
run: ./dev/ci/fetch-cache-az-blob-storage
id: fetch_runtime_cache
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
BLOB_NAME: binaries/macos-runtime-${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd
CACHE_PATH: packaging/binaries/macos/runtime-output
- name: Compile runtime
run: ./setup-runtime -w work -o runtime-output -j 4
if: steps.fetch_runtime_cache.outputs.cache-hit != 'true'
working-directory: packaging/binaries/macos
- name: Update runtime cache
run: ./dev/ci/update-cache-az-blob-storage
if: steps.fetch_runtime_cache.outputs.cache-hit != 'true'
env:
AZURE_STORAGE_CONNECTION_STRING: ${{ secrets.AZURE_CI_STORAGE_CONNECTION_STRING }}
BLOB_NAME: binaries/macos-runtime-${{ steps.determine_runtime_version.outputs.version }}-${{ matrix.runner }}-${{ matrix.arch }}.tar.zstd
CACHE_PATH: packaging/binaries/macos/runtime-output
- name: Build binaries
run: ./build -p "$WORKSPACE" -r runtime-output -w work -o output -j 4 passenger nginx
env:
WORKSPACE: ${{ github.workspace }}
working-directory: packaging/binaries/macos
- uses: actions/upload-artifact@v4
with:
name: binaries-macos-${{ matrix.arch }}
path: 'output/**/*'
- name: Package binaries
run: ./package -i output -o output
working-directory: packaging/binaries/macos
- name: Cache test suite gem bundle
uses: actions/cache@v4
with:
path: packaging/binaries/macos/runtime-output/gems
key: test-gems-${{ hashFiles('packaging/binaries/shared/Gemfile.lock', 'packaging/binaries/shared/definitions/ruby_versions') }}-${{ matrix.runner }}-${{ matrix.arch }}
- name: Test
run: ./test -p "$WORKSPACE" -r runtime-output -i output -I output
env:
WORKSPACE: ${{ github.workspace }}
working-directory: packaging/binaries/macos
- name: Teardown sccache
run: ./dev/ci/teardown-sccache
if: always()
- name: Archive configure logs
uses: actions/upload-artifact@v4
if: failure()
with:
name: generic-binaries-logs-macos
path: packaging/binaries/macos/work/*/config.log
if-no-files-found: ignore