-
Notifications
You must be signed in to change notification settings - Fork 2
256 lines (246 loc) · 8.13 KB
/
precompiled.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
name: precompiled
concurrency:
group: "${{github.workflow}}-${{github.ref}}"
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: "0 8 * * 3" # At 08:00 on Wednesday # https://crontab.guru/#0_8_*_*_3
push:
branches:
- main
- v*.*.x
tags:
- v*.*.*
pull_request:
types: [opened, synchronize]
branches:
- '*'
paths: ["precompiled/**/*", ".github/workflows/precompiled.yml"]
jobs:
precompiled:
strategy:
fail-fast: false
matrix:
runs-on: ["ubuntu-latest", "macos-13", "windows-latest"]
ruby: ["3.0", "3.1", "3.2", "3.3", "head"]
runs-on: ${{matrix.runs-on}}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
working-directory: precompiled
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- uses: actions/cache@v4
with:
path: precompiled/ports
key: precompiled-ports-${{matrix.runs-on}}-${{hashFiles('precompiled/ext/precompiled/extconf.rb')}}
- run: bundle exec rake compile test
working-directory: precompiled
cruby-package:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: precompiled/ports/archives
key: archives-ubuntu-${{hashFiles('precompiled/ext/precompiled/extconf.rb')}}
- uses: ruby/setup-ruby@v1
with:
working-directory: precompiled
ruby-version: "3.2"
bundler-cache: true
- run: ./bin/test-gem-build gems ruby
working-directory: precompiled
- uses: actions/upload-artifact@v4
with:
name: cruby-gem
path: precompiled/gems
retention-days: 1
cruby-install:
needs: "cruby-package"
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "macos-13", "windows-latest"]
ruby: ["3.0", "3.1", "3.2", "3.3", "head"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
working-directory: precompiled
ruby-version: "${{ matrix.ruby }}"
- uses: actions/download-artifact@v4
with:
name: cruby-gem
path: precompiled/gems
- run: ./bin/test-gem-install gems
working-directory: precompiled
shell: bash
rcd_image_version:
runs-on: ubuntu-latest
outputs:
rcd_image_version: ${{steps.rcd_image_version.outputs.rcd_image_version}}
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
working-directory: precompiled
ruby-version: "3.2"
bundler-cache: true
bundler: latest
- id: rcd_image_version
run: bundle exec ruby -e 'require "rake_compiler_dock"; puts "rcd_image_version=#{RakeCompilerDock::IMAGE_VERSION}"' >> $GITHUB_OUTPUT
working-directory: precompiled
cruby-native-package:
needs: ["rcd_image_version"]
strategy:
fail-fast: false
matrix:
platform:
- "aarch64-linux-gnu"
- "aarch64-linux-musl"
- "arm-linux-gnu"
- "arm-linux-musl"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x64-mingw32"
- "x86-linux-gnu"
- "x86-linux-musl"
- "x86_64-darwin"
- "x86_64-linux-gnu"
- "x86_64-linux-musl"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: precompiled/ports/archives
key: archives-ubuntu-${{hashFiles('precompiled/ext/precompiled/extconf.rb')}}
- run: |
docker run --rm -v $PWD/precompiled:/precompiled -w /precompiled \
ghcr.io/rake-compiler/rake-compiler-dock-image:${{ needs.rcd_image_version.outputs.rcd_image_version }}-mri-${{ matrix.platform }} \
./bin/test-gem-build gems ${{ matrix.platform }}
- uses: actions/upload-artifact@v4
with:
name: "cruby-${{ matrix.platform }}-gem"
path: precompiled/gems
retention-days: 1
cruby-linux-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
platform:
- "aarch64-linux-gnu"
- "aarch64-linux-musl"
- "arm-linux-gnu"
- "arm-linux-musl"
- "x86-linux-gnu"
- "x86-linux-musl"
- "x86_64-linux-gnu"
- "x86_64-linux-musl"
ruby: ["3.0", "3.1", "3.2", "3.3"]
include:
# declare docker image for each platform
- { platform: aarch64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash &&" }
- { platform: arm-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash &&" }
- { platform: x86-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash &&" }
- { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash &&" }
# declare docker platform for each platform
- { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64" }
- { platform: aarch64-linux-musl, docker_platform: "--platform=linux/arm64" }
- { platform: arm-linux-gnu, docker_platform: "--platform=linux/arm/v7" }
- { platform: arm-linux-musl, docker_platform: "--platform=linux/arm/v7" }
- { platform: x86-linux-gnu, docker_platform: "--platform=linux/386" }
- { platform: x86-linux-musl, docker_platform: "--platform=linux/386" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: cruby-${{ matrix.platform }}-gem
path: precompiled/gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v $PWD/precompiled:/precompiled -w /precompiled \
${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \
sh -c "
gem update --system &&
${{ matrix.bootstrap }}
./bin/test-gem-install gems
"
cruby-x86_64-darwin-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-darwin-gem
path: precompiled/gems
- run: ./bin/test-gem-install gems
working-directory: precompiled
cruby-arm64-darwin-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-arm64-darwin-gem
path: precompiled/gems
- run: ./bin/test-gem-install gems
working-directory: precompiled
cruby-x64-mingw32-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0"]
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw32-gem
path: precompiled/gems
- run: ./bin/test-gem-install gems
working-directory: precompiled
cruby-x64-mingw-ucrt-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.1", "3.2", "3.3"]
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x64-mingw-ucrt-gem
path: precompiled/gems
- run: ./bin/test-gem-install gems
working-directory: precompiled