Skip to content

Commit

Permalink
ci: extract the cruby-package job
Browse files Browse the repository at this point in the history
with the expectation that we can re-use it in upstream.yml to test
against rake-compiler-dock snapshots.
  • Loading branch information
flavorjones committed Dec 10, 2024
1 parent abe8662 commit 8cf4624
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 34 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/_cruby_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
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: "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:${{ inputs.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
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

rcd_image_version:
runs-on: ubuntu-latest
outputs:
rcd_image_version: "snapshot"

0 comments on commit 8cf4624

Please sign in to comment.