Skip to content

Commit

Permalink
ci: expand linux native install test to include all musl platforms
Browse files Browse the repository at this point in the history
Also:
- matrix the linux and darwin native install tests
- add a "install on setup-ruby" test
  • Loading branch information
flavorjones committed Dec 13, 2024
1 parent 2d5117c commit 43c1308
Showing 1 changed file with 41 additions and 75 deletions.
116 changes: 41 additions & 75 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -596,51 +596,7 @@ jobs:
path: gems
retention-days: 1

cruby-aarch64-linux-gnu-install:
needs: ["cruby-package", "ruby_versions"]
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: cruby-aarch64-linux-gnu-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
--platform=linux/arm64/v8 \
ruby:${{matrix.ruby}} \
./scripts/test-gem-install gems
cruby-arm-linux-gnu-install:
needs: ["cruby-package", "ruby_versions"]
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: cruby-arm-linux-gnu-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
--platform=linux/arm/v7 \
ruby:${{matrix.ruby}} \
./scripts/test-gem-install gems
cruby-x86_64-linux-gnu-install:
cruby-install-with-setup-ruby:
needs: ["cruby-package", "ruby_versions"]
strategy:
fail-fast: false
Expand All @@ -660,60 +616,70 @@ jobs:
path: gems
- run: ./scripts/test-gem-install gems

cruby-x86_64-linux-musl-install:
needs: ["cruby-package"]
strategy:
fail-fast: false
runs-on: ubuntu-latest
container:
image: ghcr.io/sparklemotion/nokogiri-test:alpine
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-linux-musl-gem
path: gems
- run: ./scripts/test-gem-install gems

cruby-x86_64-darwin-install:
cruby-linux-install-matrix:
needs: ["cruby-package", "ruby_versions"]
name: "cruby-${{ matrix.platform }}-install (${{ matrix.ruby }})"
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: macos-13
platform:
- aarch64-linux-gnu
- aarch64-linux-musl
- arm-linux-gnu
- arm-linux-musl
- x86_64-linux-gnu
- x86_64-linux-musl
include:
# declare docker image for each platform
- { platform: aarch64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash build-base &&" }
- { platform: arm-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash build-base &&" }
- { platform: x86_64-linux-musl, docker_tag: "-alpine", bootstrap: "apk add bash build-base &&" }
# declare docker platform for each platform
- { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64/v8" }
- { platform: aarch64-linux-musl, docker_platform: "--platform=linux/arm64/v8" }
- { platform: arm-linux-gnu, docker_platform: "--platform=linux/arm/v7" }
- { platform: arm-linux-musl, docker_platform: "--platform=linux/arm/v7" }
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v4
with:
name: cruby-x86_64-darwin-gem
name: cruby-${{ matrix.platform }}-gem
path: gems
- run: ./scripts/test-gem-install gems

cruby-arm64-darwin-install:
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v $PWD:/nokogiri -w /nokogiri \
${{ matrix.docker_platform }} ruby:${{ matrix.ruby }}${{ matrix.docker_tag }} \
sh -c "
${{ matrix.bootstrap }}
${{ matrix.rubyenv }}
./scripts/test-gem-install gems
"
cruby-darwin-install-matrix:
needs: ["cruby-package", "ruby_versions"]
name: "cruby-${{ matrix.platform }}-install (${{ matrix.ruby }})"
strategy:
fail-fast: false
matrix:
ruby: ${{ fromJSON(needs.ruby_versions.outputs.minors) }}
runs-on: macos-14
include:
- { platform: x86_64-darwin, os: macos-13 }
- { platform: arm64-darwin, os: macos-14 }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
ruby-version: "${{ matrix.ruby }}"
- uses: actions/download-artifact@v4
with:
name: cruby-arm64-darwin-gem
name: cruby-${{ matrix.platform }}-gem
path: gems
- run: ./scripts/test-gem-install gems

Expand Down Expand Up @@ -772,6 +738,6 @@ jobs:
name: jruby-gem
path: gems
- run: |
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
docker run --rm -v "$PWD:/nokogiri" -w /nokogiri \
jruby:${{matrix.jruby}}-jre${{matrix.jre}} \
./scripts/test-gem-install gems

0 comments on commit 43c1308

Please sign in to comment.