From 8cf46245859f92f5a6a62a4885032c5b4bb33586 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Tue, 10 Dec 2024 17:33:00 -0500 Subject: [PATCH] ci: extract the cruby-package job with the expectation that we can re-use it in upstream.yml to test against rake-compiler-dock snapshots. --- .github/workflows/_cruby_package.yml | 44 ++++++++++++++++++++++++++++ .github/workflows/ci.yml | 37 ++--------------------- .github/workflows/upstream.yml | 5 ++++ 3 files changed, 52 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/_cruby_package.yml diff --git a/.github/workflows/_cruby_package.yml b/.github/workflows/_cruby_package.yml new file mode 100644 index 00000000000..08800213191 --- /dev/null +++ b/.github/workflows/_cruby_package.yml @@ -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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d71bca53f5..f6639de2dbc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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"] diff --git a/.github/workflows/upstream.yml b/.github/workflows/upstream.yml index 834f3d17937..6cba55d39f5 100644 --- a/.github/workflows/upstream.yml +++ b/.github/workflows/upstream.yml @@ -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"