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 d7bd22b
Show file tree
Hide file tree
Showing 2 changed files with 47 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

0 comments on commit d7bd22b

Please sign in to comment.