Skip to content

Commit

Permalink
ci: matrix native gem build and installation
Browse files Browse the repository at this point in the history
- actually run tests on windows (previously just installed)
- keep musl tests separate for now (pending first-class musl support)
  • Loading branch information
flavorjones committed Jan 24, 2024
1 parent 61f7603 commit f51afd3
Showing 1 changed file with 75 additions and 129 deletions.
204 changes: 75 additions & 129 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,16 @@ jobs:
- run: ./bin/test-gem-install gems -- --${{ matrix.syslib }}-system-libraries ${{ matrix.compile_flags }}
shell: bash

cruby-native-package:
needs: ["native_setup"]
build_native_gem:
needs: native_setup
name: "build native"
strategy:
fail-fast: false
matrix:
plat:
platform:
- "aarch64-linux"
- "arm-linux"
- "arm64-darwin" # github actions does not support this runtime as of 2022-12, but let's build anyway
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x64-mingw32"
- "x86-linux"
Expand All @@ -237,162 +238,107 @@ jobs:
- uses: actions/cache@v4
with:
path: ports/archives
key: ports-archives-tarball-${{hashFiles('ext/sqlite3/extconf.rb','dependencies.yml')}}
- env:
DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.native_setup.outputs.rcd_image_version}}-mri-${{matrix.plat}}"
run: |
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 ${DOCKER_IMAGE} \
./bin/test-gem-build gems ${{matrix.plat}}
key: ports-archives-tarball-${{ hashFiles('ext/sqlite3/extconf.rb','dependencies.yml') }}
- run: |
docker run --rm -v $PWD:/work -w /work \
ghcr.io/rake-compiler/rake-compiler-dock-image:${{ needs.native_setup.outputs.rcd_image_version }}-mri-${{ matrix.platform }} \
./bin/test-gem-build gems ${{ matrix.platform }}
- uses: actions/upload-artifact@v3
with:
name: "cruby-${{matrix.plat}}-gem"
name: "cruby-${{ matrix.platform }}-gem"
path: gems
retention-days: 1

cruby-aarch64-linux-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: cruby-aarch64-linux-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
--platform=linux/arm64/v8 \
ruby:${{matrix.ruby}} \
./bin/test-gem-install ./gems
cruby-arm-linux-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: cruby-arm-linux-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
--platform=linux/arm/v7 \
ruby:${{matrix.ruby}} \
./bin/test-gem-install ./gems
## arm64-darwin installation testing is omitted until github actions supports it
# cruby-arm64-darwin-install:
# ...

cruby-x64-mingw-ucrt-install:
needs: ["cruby-native-package"]
test_architecture_matrix:
name: "${{ matrix.platform }} ${{ matrix.ruby }}"
needs: build_native_gem
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@v3
with:
name: cruby-x64-mingw-ucrt-gem
path: gems
- run: |
gem install --verbose --no-document gems/*.gem
gem list -d sqlite3
ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
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@v3
with:
name: cruby-x64-mingw32-gem
path: gems
- run: |
gem install --verbose --no-document gems/*.gem
gem list -d sqlite3
ruby -rsqlite3 -e 'puts SQLite3::SQLITE_LOADED_VERSION'
cruby-x86-linux-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
platform:
- aarch64-linux
# - aarch64-linux-gnu
# - aarch64-linux-musl
- arm-linux
# - arm-linux-gnu
# - arm-linux-musl
- x86-linux
# - x86-linux-gnu
# - x86-linux-musl
- x86_64-linux
# - x86_64-linux-gnu
# - x86_64-linux-musl
ruby: ["3.3", "3.2", "3.1", "3.0"]
include:
# # declare docker image for each platform
# - { platform: aarch64-linux-musl, docker_tag: "-alpine" }
# - { platform: arm-linux-musl, docker_tag: "-alpine" }
# - { platform: x86-linux-musl, docker_tag: "-alpine" }
# - { platform: x86_64-linux-musl, docker_tag: "-alpine" }
# declare docker platform for each platform
- { platform: aarch64-linux, docker_platform: "--platform=linux/arm64" }
# - { platform: aarch64-linux-gnu, docker_platform: "--platform=linux/arm64" }
# - { platform: aarch64-linux-musl, docker_platform: "--platform=linux/arm64" }
- { platform: arm-linux, docker_platform: "--platform=linux/arm/v7" }
# - { platform: arm-linux-gnu, docker_platform: "--platform=linux/arm/v7" }
# - { platform: arm-linux-musl, docker_platform: "--platform=linux/arm/v7" }
- { platform: x86-linux, docker_platform: "--platform=linux/386" }
# - { 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@v3
with:
name: cruby-x86-linux-gem
name: cruby-${{ matrix.platform }}-gem
path: gems
- run: |
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
docker run --rm -v "$(pwd):/sqlite3" -w /sqlite3 \
--platform=linux/386 \
ruby:${{matrix.ruby}} \
docker run --rm -v $PWD:/work -w /work \
${{ matrix.docker_platform}} ruby:${{ matrix.ruby }} \
./bin/test-gem-install ./gems
cruby-x86_64-darwin-install:
needs: ["cruby-native-package"]
test_the_rest:
name: "${{ matrix.platform }} ${{ matrix.ruby }}"
needs: build_native_gem
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
- uses: actions/download-artifact@v3
with:
name: cruby-x86_64-darwin-gem
path: gems
- run: ./bin/test-gem-install gems

cruby-x86_64-linux-install:
needs: ["cruby-native-package"]
strategy:
fail-fast: false
matrix:
ruby: ["3.0", "3.1", "3.2", "3.3"]
runs-on: ubuntu-latest
os: [macos]
ruby: ["3.3", "3.2", "3.1", "3.0"]
include:
- os: macos
platform: x86_64-darwin
# # arm64-darwin installation testing is omitted until github actions supports it
# - os: macos
# platform: arm64-darwin
- os: windows
ruby: "3.0"
platform: x64-mingw32
- os: windows
ruby: "3.1"
platform: x64-mingw-ucrt
- os: windows
ruby: "3.2"
platform: x64-mingw-ucrt
- os: windows
ruby: "3.3"
platform: x64-mingw-ucrt
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
ruby-version: "${{matrix.ruby}}"
ruby-version: "${{ matrix.ruby }}"
- uses: actions/download-artifact@v3
with:
name: cruby-x86_64-linux-gem
name: cruby-${{ matrix.platform }}-gem
path: gems
- run: ./bin/test-gem-install gems
shell: bash

cruby-x86_64-linux-musl-install:
needs: ["cruby-native-package"]
needs: build_native_gem
strategy:
fail-fast: false
matrix:
Expand Down

0 comments on commit f51afd3

Please sign in to comment.