Skip to content

Commit a8425c5

Browse files
committed
CI: Build the images on arm64 and x86_64
1 parent f76c9cf commit a8425c5

File tree

2 files changed

+27
-7
lines changed

2 files changed

+27
-7
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,25 @@ jobs:
4444
strategy:
4545
fail-fast: false
4646
matrix:
47+
os:
48+
- ubuntu-latest
49+
- ubuntu-24.04-arm
50+
platform:
51+
- aarch64-linux-gnu
52+
- aarch64-linux-musl
53+
- aarch64-mingw-ucrt
54+
- arm-linux-gnu
55+
- arm-linux-musl
56+
- arm64-darwin
57+
- jruby
58+
- x64-mingw-ucrt
59+
- x64-mingw32
60+
- x86-linux-gnu
61+
- x86-linux-musl
62+
- x86-mingw32
63+
- x86_64-darwin
64+
- x86_64-linux-gnu
65+
- x86_64-linux-musl
4766
include:
4867
- platform: aarch64-linux-gnu
4968
alias: aarch64-linux
@@ -66,7 +85,7 @@ jobs:
6685
- platform: x86_64-linux-gnu
6786
alias: x86_64-linux
6887
- platform: x86_64-linux-musl
69-
runs-on: ubuntu-latest
88+
runs-on: ${{ matrix.os }}
7089
steps:
7190
- uses: actions/checkout@v4
7291
- uses: ruby/setup-ruby@v1
@@ -78,8 +97,8 @@ jobs:
7897
uses: actions/cache@v4
7998
with:
8099
path: tmp/build-cache
81-
key: ${{ runner.os }}-${{ matrix.platform }}-buildx-${{ github.sha }}
82-
restore-keys: ${{ runner.os }}-${{ matrix.platform }}-buildx
100+
key: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }}-buildx-${{ github.sha }}
101+
restore-keys: ${{ runner.os }}-on-${{ runner.arch }}-${{ matrix.platform }}-buildx
83102
- name: Build docker image
84103
run: |
85104
docker buildx create --driver docker-container --use
@@ -100,7 +119,8 @@ jobs:
100119
bundle exec rake clean clobber
101120
bundle exec rake gem:${{ matrix.platform }}
102121
103-
- name: Upload native gem
122+
- if: runner.arch == 'x86_64'
123+
name: Upload native gem
104124
uses: actions/upload-artifact@v4
105125
with:
106126
name: gem-${{ matrix.platform }}

build/parallel_docker_build.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ def docker_build_cmd(platform=nil)
99
if platform
1010
cache_version = RakeCompilerDock::IMAGE_VERSION.split(".").take(2).join(".")
1111
cache = File.join("cache", cache_version, platform)
12-
"docker buildx build --cache-to=type=local,dest=#{cache},mode=max --cache-from=type=local,src=#{cache} --load"
12+
"docker buildx build --cache-to=type=local,dest=#{cache},mode=max --cache-from=type=local,src=#{cache} --progress=plain"
1313
else
1414
return nil
1515
end
1616
else
17-
ENV['RCD_DOCKER_BUILD'] || "docker buildx build"
17+
ENV['RCD_DOCKER_BUILD'] || "docker buildx build --progress=plain"
1818
end
1919
Shellwords.split(cmd)
2020
end
@@ -23,7 +23,7 @@ def docker_build_cmd(platform=nil)
2323
#
2424
# The layers will be reused in subsequent builds, even if they run in parallel.
2525
def docker_build(filename, tag: nil, output: false, platform: )
26-
cmd = docker_build_cmd
26+
cmd = docker_build_cmd(platform)
2727
return if cmd.nil?
2828
tag_args = ["-t", tag] if tag
2929
push_args = ["--push"] if output == 'push'

0 commit comments

Comments
 (0)