Skip to content

Commit 69a9ff5

Browse files
committed
attempt to make jobs pass in arm
1 parent a37418a commit 69a9ff5

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

.github/workflows/build.yml

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -337,37 +337,41 @@ jobs:
337337
name: Test (ruby) (${{ matrix.container.version }}, ${{ matrix.platform }}, ${{ matrix.container.libc }})
338338
needs: build-ruby
339339
runs-on: ${{ matrix.runner }}
340-
container: ${{ matrix.container.image }}
341340
steps:
341+
- name: Start container
342+
id: container
343+
run: |
344+
docker run --rm -d -v "${PWD}":"${PWD}" -w "${PWD}" --platform linux/${{ matrix.platform }} ${{ matrix.container.image }} /bin/sleep 64d | tee container_id
345+
docker exec -w "${PWD}" $(cat container_id) uname -a
346+
echo "id=$(cat container_id)" >> $GITHUB_OUTPUT
342347
- name: Install Alpine system dependencies
343348
if: ${{ matrix.container.libc == 'musl' }}
344-
run: apk add --no-cache build-base linux-headers bash python3 git curl tar
349+
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} apk add --no-cache build-base linux-headers bash python3 git curl tar
345350
- name: Update Rubygems and Bundler
346351
run: |
347-
gem update --system
348-
gem install bundler
352+
docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem update --system
353+
docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem install bundler
349354
- name: Set metadata
350355
id: set-metadata
351356
run: |
352-
ruby -e 'puts Gem.platforms.last.to_s' | tee gem_platform
357+
docker exec -w "${PWD}" ${{ steps.container.outputs.id }} ruby -e 'puts Gem.platforms.last.to_s' | tee gem_platform
353358
echo "GEM_PLATFORM=$(cat gem_platform)" >> $GITHUB_OUTPUT
354359
- name: Download a single artifact
355360
uses: actions/download-artifact@v4
356361
with:
357362
name: gem-${{ needs.build-ruby.outputs.GEM_VERSION }}-ruby
358363
path: pkg
359364
- name: Install gem
360-
run: gem install --verbose pkg/libv8-node-${{ needs.build-ruby.outputs.GEM_VERSION }}.gem
365+
run: docker exec -w "${PWD}" ${{ steps.container.outputs.id }} gem install --verbose pkg/libv8-node-${{ needs.build-ruby.outputs.GEM_VERSION }}.gem
361366
- name: Test with mini_racer
362367
run: |
363-
export BUNDLE_FORCE_RUBY_PLATFORM=y
364368
git clone https://github.com/rubyjs/mini_racer.git test/mini_racer --depth 1
365369
cd test/mini_racer
366370
ruby -i -ne '$_ =~ /^\s+LIBV8_NODE_VERSION/ ? print(" LIBV8_NODE_VERSION = \"${{ needs.build-ruby.outputs.GEM_VERSION }}\"\n") : print' lib/mini_racer/version.rb
367371
ruby -i -ne '$_ =~ /spec.required_ruby_version/ ? "" : print' mini_racer.gemspec
368-
bundle install
369-
bundle exec rake compile
370-
bundle exec rake test
372+
docker exec -w "${PWD}/test/mini_racer" -e BUNDLE_FORCE_RUBY_PLATFORM=y ${{ steps.container.outputs.id }} bundle install
373+
docker exec -w "${PWD}/test/mini_racer" -e BUNDLE_FORCE_RUBY_PLATFORM=y ${{ steps.container.outputs.id }} bundle exec rake compile
374+
docker exec -w "${PWD}/test/mini_racer" -e BUNDLE_FORCE_RUBY_PLATFORM=y ${{ steps.container.outputs.id }} bundle exec rake test
371375
test-darwin:
372376
strategy:
373377
fail-fast: false

0 commit comments

Comments
 (0)