Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: test rake-compiler-dock edge in the upstream workflow #3366

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/_cruby_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
on:
workflow_call:
inputs:
rcd_image_version:
description: The version of the rake-compiler-dock image to use
required: true
type: string

jobs:
cruby-package:
name: ${{ matrix.plat }}
strategy:
fail-fast: false
matrix:
plat:
- "aarch64-linux"
- "arm-linux"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x64-mingw32"
- "x86-linux"
- "x86-mingw32" # github actions does not support this runtime as of 2022-12, but let's build anyway
- "x86_64-darwin"
- "x86_64-linux"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
with:
path: ports/archives
key: tarballs-ubuntu-${{ hashFiles('dependencies.yml', 'patches/**/*.patch') }}
- env:
DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{ inputs.rcd_image_version }}-mri-${{ matrix.plat }}"
run: |
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
-e RCD_VERSION=${{ inputs.rcd_image_version }} \
${DOCKER_IMAGE} \
./scripts/test-gem-build gems ${{ matrix.plat }}
- uses: actions/upload-artifact@v4
with:
name: "cruby-${{ matrix.plat }}-gem"
path: gems
retention-days: 1
37 changes: 3 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -572,40 +572,9 @@ jobs:

cruby-package:
needs: ["rcd_image_version"]
name: "cruby-package"
strategy:
fail-fast: false
matrix:
plat:
- "aarch64-linux"
- "arm-linux"
- "arm64-darwin"
- "x64-mingw-ucrt"
- "x64-mingw32"
- "x86-linux"
- "x86-mingw32" # github actions does not support this runtime as of 2022-12, but let's build anyway
- "x86_64-darwin"
- "x86_64-linux"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/cache@v4
with:
path: ports/archives
key: tarballs-ubuntu-${{hashFiles('dependencies.yml', 'patches/**/*.patch')}}
- env:
DOCKER_IMAGE: "ghcr.io/rake-compiler/rake-compiler-dock-image:${{needs.rcd_image_version.outputs.rcd_image_version}}-mri-${{matrix.plat}}"
run: |
docker run --rm -v "$(pwd):/nokogiri" -w /nokogiri \
${DOCKER_IMAGE} \
./scripts/test-gem-build gems ${{matrix.plat}}
- uses: actions/upload-artifact@v4
with:
name: "cruby-${{matrix.plat}}-gem"
path: gems
retention-days: 1
uses: ./.github/workflows/_cruby_package.yml
with:
rcd_image_version: ${{ needs.rcd_image_version.outputs.rcd_image_version }}

cruby-x86-linux-install:
needs: ["cruby-package"]
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/upstream.yml
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,8 @@ jobs:
- run: bundle install --local || bundle install
- run: bundle exec rake compile -- --disable-system-libraries
- run: bundle exec rake test

rake-compiler-dock:
uses: ./.github/workflows/_cruby_package.yml
with:
rcd_image_version: snapshot
18 changes: 15 additions & 3 deletions rakelib/extensions.rake
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,17 @@ CrossRuby = Struct.new(:version, :platform) do
when "x86-mingw32"
"i686-w64-mingw32-"
when "x86_64-linux"
"x86_64-redhat-linux-gnu-"
if RakeCompilerDock::IMAGE_VERSION >= "1.6"
"x86_64-linux-gnu-"
else
"x86_64-redhat-linux-gnu-"
end
when "x86-linux"
"i686-redhat-linux-gnu-"
if RakeCompilerDock::IMAGE_VERSION >= "1.6"
"i686-linux-gnu-"
else
"i686-redhat-linux-gnu-"
end
when "aarch64-linux"
"aarch64-linux-gnu-"
when "x86_64-darwin"
Expand Down Expand Up @@ -204,7 +212,11 @@ CrossRuby = Struct.new(:version, :platform) do
def dll_ref_versions
case platform
when X86_LINUX_PLATFORM_REGEX
{ "GLIBC" => "2.17" }
if RakeCompilerDock::IMAGE_VERSION >= "1.6"
{ "GLIBC" => "2.29" }
else
{ "GLIBC" => "2.17" }
end
when AARCH_LINUX_PLATFORM_REGEX, ARM_LINUX_PLATFORM_REGEX
{ "GLIBC" => "2.29" }
else
Expand Down
7 changes: 7 additions & 0 deletions scripts/test-gem-build
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,14 @@ set -u -x
# avoid the pernicious "fatal: detected dubious ownership in repository" errors
git config --global --add safe.directory $(realpath $(dirname $0)/..)

# RCD_VERSION is an env var that should be set in CI
if [[ "${RCD_VERSION:-}" = "snapshot" ]] ; then
bundle remove rake-compiler-dock
bundle add rake-compiler-dock --github rake-compiler/rake-compiler-dock --branch main --skip-install
fi

bundle
bundle show --paths

bundle exec rake set-version-to-timestamp

Expand Down
Loading