Bypass generate-matrix job

This commit is contained in:
Bart Thomee
2025-07-27 12:53:52 -04:00
parent b869902453
commit a5217e433d
2 changed files with 30 additions and 38 deletions

View File

@@ -127,54 +127,59 @@ jobs:
# Expose environment variables used by other jobs. This is a workaround, as # Expose environment variables used by other jobs. This is a workaround, as
# environment variables cannot be passed as inputs to reusable workflows. They # environment variables cannot be passed as inputs to reusable workflows. They
# can, however, be passed as inputs to actions. # can, however, be passed as inputs to actions.
expose-env: generate-outputs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Expose environment variables - name: Generate outputs
run: echo "" id: generate
run: |
echo "strategy_matrix_architecture=$(jq -c <<< '${{ env.STRATEGY_MATRIX_ARCHITECTURE }}')" >> "$GITHUB_OUTPUT"
echo "strategy_matrix_os=$(jq -c <<< '${{ env.STRATEGY_MATRIX_OS }}')" >> "$GITHUB_OUTPUT"
echo "strategy_matrix_build_type=$(jq -c <<< '${{ env.STRATEGY_MATRIX_BUILD_TYPE }}')" >> "$GITHUB_OUTPUT"
echo "strategy_matrix_cmake_args=$(jq -c <<< '${{ env.STRATEGY_MATRIX_CMAKE_ARGS }}')" >> "$GITHUB_OUTPUT"
outputs: outputs:
conan_global_conf: ${{ env.CONAN_GLOBAL_CONF }} conan_global_conf: ${{ env.CONAN_GLOBAL_CONF }}
strategy_matrix_architecture: ${{ env.STRATEGY_MATRIX_ARCHITECTURE }} strategy_matrix_architecture: ${{ steps.generate.outputs.strategy_matrix_architecture }}
strategy_matrix_os: ${{ env.STRATEGY_MATRIX_OS }} strategy_matrix_os: ${{ steps.generate.outputs.strategy_matrix_os }}
strategy_matrix_build_type: ${{ env.STRATEGY_MATRIX_BUILD_TYPE }} strategy_matrix_build_type: ${{ steps.generate.outputs.strategy_matrix_build_type }}
strategy_matrix_cmake_args: ${{ env.STRATEGY_MATRIX_CMAKE_ARGS }} strategy_matrix_cmake_args: ${{ steps.generate.outputs.strategy_matrix_cmake_args }}
# Install and cache the dependencies using various configurations. # Install and cache the dependencies using various configurations.
install-dependencies: install-dependencies:
needs: needs:
- expose-env - generate-outputs
uses: ./.github/workflows/install-dependencies.yml uses: ./.github/workflows/install-dependencies.yml
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
architecture: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_architecture) }} architecture: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_architecture) }}
os: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_os) }} os: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_os) }}
build_type: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_build_type) }} build_type: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_build_type) }}
with: with:
build_dir: ${{ inputs.build_dir }} build_dir: ${{ inputs.build_dir }}
build_type: ${{ strategy.matrix.build_type }} build_type: ${{ strategy.matrix.build_type }}
conan_global_conf: ${{ needs.expose-env.outputs.conan_global_conf }} conan_global_conf: ${{ needs.generate-outputs.outputs.conan_global_conf }}
container: ghcr.io/xrplf/ci/${{ strategy.matrix.os.distro }}-${{ strategy.matrix.os.release }}:${{ strategy.matrix.os.compiler_name }}-${{ strategy.matrix.os.compiler_version }} container: ghcr.io/xrplf/ci/${{ strategy.matrix.os.distro }}-${{ strategy.matrix.os.release }}:${{ strategy.matrix.os.compiler_name }}-${{ strategy.matrix.os.compiler_version }}
runner: ${{ strategy.matrix.architecture.runner }} runner: ${{ strategy.matrix.architecture.runner }}
# Build and test the binary using various configurations. # Build and test the binary using various configurations.
build-and-test: build-and-test:
needs: needs:
- expose-env - generate-outputs
- install-dependencies - install-dependencies
uses: ./.github/workflows/build-nix.yml uses: ./.github/workflows/build-nix.yml
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
architecture: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_architecture) }} architecture: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_architecture) }}
os: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_os) }} os: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_os) }}
build_type: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_build_type) }} build_type: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_build_type) }}
cmake_args: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_cmake_args) }} cmake_args: ${{ fromJson(needs.generate-outputs.outputs.strategy_matrix_cmake_args) }}
with: with:
build_dir: ${{ inputs.build_dir }} build_dir: ${{ inputs.build_dir }}
build_type: ${{ strategy.matrix.build_type }} build_type: ${{ strategy.matrix.build_type }}
cmake_args: ${{ strategy.matrix.cmake_args }} cmake_args: ${{ strategy.matrix.cmake_args }}
cmake_generator: "Ninja" cmake_generator: "Ninja"
conan_global_conf: ${{ needs.expose-env.outputs.conan_global_conf }} conan_global_conf: ${{ needs.generate-outputs.outputs.conan_global_conf }}
container: ghcr.io/xrplf/ci/${{ strategy.matrix.os.distro }}-${{ strategy.matrix.os.release }}:${{ strategy.matrix.os.compiler_name }}-${{ strategy.matrix.os.compiler_version }} container: ghcr.io/xrplf/ci/${{ strategy.matrix.os.distro }}-${{ strategy.matrix.os.release }}:${{ strategy.matrix.os.compiler_name }}-${{ strategy.matrix.os.compiler_version }}
runner: ${{ strategy.matrix.architecture.runner }} runner: ${{ strategy.matrix.architecture.runner }}

View File

@@ -107,29 +107,17 @@ jobs:
strategy_matrix_build_type: ${{ env.STRATEGY_MATRIX_BUILD_TYPE }} strategy_matrix_build_type: ${{ env.STRATEGY_MATRIX_BUILD_TYPE }}
strategy_matrix_cmake_args: ${{ env.STRATEGY_MATRIX_CMAKE_ARGS }} strategy_matrix_cmake_args: ${{ env.STRATEGY_MATRIX_CMAKE_ARGS }}
# Generate the strategy matrix.
generate-matrix:
needs:
- expose-env
uses: ./.github/workflows/generate-matrix.yml
with:
architecture: ${{ needs.expose-env.outputs.strategy_matrix_architecture }}
os: ${{ needs.expose-env.outputs.strategy_matrix_os }}
build_type: ${{ needs.expose-env.outputs.strategy_matrix_build_type }}
cmake_args: ${{ needs.expose-env.outputs.strategy_matrix_cmake_args }}
# Install and cache the dependencies using various configurations. # Install and cache the dependencies using various configurations.
install-dependencies: install-dependencies:
needs: needs:
- expose-env - expose-env
- generate-matrix
uses: ./.github/workflows/install-dependencies.yml uses: ./.github/workflows/install-dependencies.yml
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
architecture: ${{ fromJson(needs.generate-matrix.outputs.architecture) }} architecture: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_architecture) }}
os: ${{ fromJson(needs.generate-matrix.outputs.os) }} os: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_os) }}
build_type: ${{ fromJson(needs.generate-matrix.outputs.build_type) }} build_type: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_build_type) }}
with: with:
build_dir: ${{ inputs.build_dir }} build_dir: ${{ inputs.build_dir }}
build_type: ${{ strategy.matrix.build_type }} build_type: ${{ strategy.matrix.build_type }}
@@ -141,16 +129,15 @@ jobs:
build-and-test: build-and-test:
needs: needs:
- expose-env - expose-env
- generate-matrix
- install-dependencies - install-dependencies
uses: ./.github/workflows/build-nix.yml uses: ./.github/workflows/build-nix.yml
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
architecture: ${{ fromJson(needs.generate-matrix.outputs.architecture) }} architecture: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_architecture) }}
os: ${{ fromJson(needs.generate-matrix.outputs.os) }} os: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_os) }}
build_type: ${{ fromJson(needs.generate-matrix.outputs.build_type) }} build_type: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_build_type) }}
cmake_args: ${{ fromJson(needs.generate-matrix.outputs.cmake_args) }} cmake_args: ${{ fromJson(needs.expose-env.outputs.strategy_matrix_cmake_args) }}
with: with:
build_dir: ${{ inputs.build_dir }} build_dir: ${{ inputs.build_dir }}
build_type: ${{ strategy.matrix.build_type }} build_type: ${{ strategy.matrix.build_type }}