Skip to content

Commit a6259b1

Browse files
committed
CI: Try to use macos-latest on arm64 to build arm images
1 parent 6bbb52c commit a6259b1

File tree

1 file changed

+12
-73
lines changed

1 file changed

+12
-73
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ concurrency:
44
cancel-in-progress: true
55
on:
66
workflow_dispatch:
7-
schedule:
8-
- cron: "0 5 * * 3" # At 05:00 on Wednesday # https://crontab.guru/#0_5_*_*_3
97
push:
108
branches:
119
- main
@@ -17,62 +15,28 @@ on:
1715
- "*"
1816

1917
jobs:
20-
build_source_gem:
21-
name: build source
22-
runs-on: ubuntu-latest
23-
steps:
24-
- uses: actions/checkout@v4
25-
- uses: ruby/setup-ruby@v1
26-
with:
27-
ruby-version: "3.3"
28-
working-directory: test/rcd_test
29-
bundler-cache: true
30-
31-
- name: Build source gem
32-
run: |
33-
cd test/rcd_test/
34-
bundle exec rake gem
35-
36-
- name: Upload source gem
37-
uses: actions/upload-artifact@v4
38-
with:
39-
name: gem-ruby
40-
path: test/rcd_test/pkg/rcd_test-?.?.?.gem # e.g. rcd_test-1.0.0.gem
41-
4218
build_native_gem:
4319
name: build native
4420
strategy:
4521
fail-fast: false
4622
matrix:
4723
include:
4824
- platform: aarch64-linux-gnu
49-
alias: aarch64-linux
50-
- platform: aarch64-linux-musl
51-
- platform: arm-linux-gnu
52-
alias: arm-linux
53-
- platform: arm-linux-musl
54-
- platform: arm64-darwin
55-
- platform: jruby
56-
- platform: x64-mingw-ucrt
57-
static: true
58-
- platform: x64-mingw32
59-
static: true
60-
- platform: x86-linux-gnu
61-
alias: x86-linux
62-
- platform: x86-linux-musl
63-
- platform: x86-mingw32
64-
- platform: x86_64-darwin
65-
- platform: x86_64-linux-gnu
66-
alias: x86_64-linux
67-
- platform: x86_64-linux-musl
68-
runs-on: ubuntu-latest
25+
runs-on: macos-latest
6926
steps:
7027
- uses: actions/checkout@v4
71-
- uses: ruby/setup-ruby@v1
28+
- uses: ruby/setup-ruby-pkgs@v1
7229
with:
7330
ruby-version: "3.3"
74-
bundler-cache: true
75-
31+
brew: "docker docker-buildx colima"
32+
- name: enable buildx command
33+
run: |
34+
mkdir -p ~/.docker
35+
echo '{"cliPluginsExtraDirs": ["/opt/homebrew/lib/docker/cli-plugins"]}' > ~/.docker/config.json
36+
cat ~/.docker/config.json
37+
- name: start colima
38+
run: |
39+
colima start
7640
- name: Fetch docker buildx layer cache
7741
uses: actions/cache@v4
7842
with:
@@ -82,7 +46,7 @@ jobs:
8246
- name: Build docker image
8347
run: |
8448
docker buildx create --driver docker-container --use
85-
bundle exec rake build:x86:${{ matrix.platform }} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new"
49+
bundle exec rake build:arm:${{ matrix.platform }} RCD_DOCKER_BUILD="docker buildx build --cache-from=type=local,src=tmp/build-cache --cache-to=type=local,dest=tmp/build-cache-new"
8650
docker images
8751
- name: Update and prune docker buildx layer cache
8852
run: |
@@ -137,31 +101,6 @@ jobs:
137101
name: gem-${{ matrix.alias }}
138102
path: test/rcd_test/pkg/*-*-*.gem
139103

140-
test_source_gem:
141-
name: source gem
142-
needs: build_source_gem
143-
strategy:
144-
fail-fast: false
145-
matrix:
146-
os: [ubuntu-latest]
147-
ruby: ["3.4.0-rc1", "3.3", "3.2", "3.1", "3.0", "2.7", "2.6", "2.5", "2.4"]
148-
runs-on: ${{ matrix.os }}
149-
steps:
150-
- uses: actions/checkout@v4
151-
- uses: ruby/setup-ruby@v1
152-
with:
153-
ruby-version: ${{ matrix.ruby }}
154-
- name: Download source gem
155-
uses: actions/download-artifact@v4
156-
with:
157-
name: gem-ruby
158-
- name: Test source gem
159-
run: |
160-
gem install --local *.gem --verbose
161-
cd test/rcd_test/
162-
bundle install
163-
ruby -rrcd_test -S rake test
164-
165104
test-x86_64-linux-setup-ruby:
166105
name: "${{ matrix.platform }} setup-ruby(${{ matrix.ruby }})"
167106
needs: build_native_gem

0 commit comments

Comments
 (0)