env is unavailable to pass to reusable workflows in 'with'

This commit is contained in:
Bart Thomee
2025-07-27 11:11:49 -04:00
parent b698085d8d
commit 4fc0c9c1f2
3 changed files with 51 additions and 14 deletions

View File

@@ -3,7 +3,13 @@
name: Clang Format
# This workflow can only be triggered by other workflows.
on: workflow_call
on:
workflow_call:
inputs:
runner:
description: 'A string representing the GitHub runner to use.'
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,7 +21,7 @@ defaults:
jobs:
clang-format:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
container: ghcr.io/xrplf/ci/tools-rippled-clang-format
steps:
# The $GITHUB_WORKSPACE and ${{ github.workspace }} might not point to the

View File

@@ -3,7 +3,13 @@
name: Levelization
# This workflow can only be triggered by other workflows.
on: workflow_call
on:
workflow_call:
inputs:
runner:
description: 'A string representing the GitHub runner to use.'
required: true
type: string
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
@@ -15,7 +21,7 @@ defaults:
jobs:
levelization:
runs-on: ubuntu-latest
runs-on: ${{ inputs.runner }}
steps:
- name: Checkout repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683

View File

@@ -23,72 +23,97 @@ env:
# The Conan remote where the dependencies will be cached.
CONAN_REMOTE_NAME: xrplf
CONAN_REMOTE_URL: https://conan.ripplex.io
# The default runner for the jobs. This can be overridden in individual jobs.
RUNNER: ubuntu-latest
jobs:
# This job exposes the environment variables that will be used by other jobs.
# It is a workaround for the env-context not being available in the 'with'
# steps when calling other workflows.
env-vars:
runs-on: ${{ env.RUNNER }}
steps:
- run: echo "Exposing environment variables."
outputs:
conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
runner: ${{ env.RUNNER }}
check-clang-format:
needs: env-vars
if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'DraftRunCI')
uses: ./.github/workflows/check-clang-format.yml
with:
runner: ${{ needs.env-vars.outputs.runner }}
check-levelization:
needs: env-vars
if: github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'DraftRunCI')
uses: ./.github/workflows/check-levelization.yml
with:
runner: ${{ needs.env-vars.outputs.runner }}
debian:
needs:
- env-vars
- check-clang-format
- check-levelization
uses: ./.github/workflows/build-debian.yml
with:
conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
conan_remote_name: ${{ needs.env-vars.outputs.conan_remote_name }}
conan_remote_url: ${{ needs.env-vars.outputs.conan_remote_url }}
secrets:
conan_username: ${{ secrets.CONAN_USERNAME }}
conan_password: ${{ secrets.CONAN_PASSWORD }}
# rhel:
# needs:
# - env-vars
# - check-clang-format
# - check-levelization
# uses: ./.github/workflows/build-rhel.yml
# with:
# conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
# conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
# conan_remote_name: ${{ needs.env-vars.outputs.conan_remote_name }}
# conan_remote_url: ${{ needs.env-vars.outputs.conan_remote_url }}
# secrets:
# conan_username: ${{ secrets.CONAN_USERNAME }}
# conan_password: ${{ secrets.CONAN_PASSWORD }}
#
# ubuntu:
# needs:
# - env-vars
# - check-clang-format
# - check-levelization
# uses: ./.github/workflows/build-ubuntu.yml
# with:
# conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
# conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
# conan_remote_name: ${{ needs.env-vars.outputs.conan_remote_name }}
# conan_remote_url: ${{ needs.env-vars.outputs.conan_remote_url }}
# secrets:
# conan_username: ${{ secrets.CONAN_USERNAME }}
# conan_password: ${{ secrets.CONAN_PASSWORD }}
#
# macos:
# needs:
# - env-vars
# - check-clang-format
# - check-levelization
# uses: ./.github/workflows/build-macos.yml
# with:
# conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
# conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
# conan_remote_name: ${{ needs.env-vars.outputs.conan_remote_name }}
# conan_remote_url: ${{ needs.env-vars.outputs.conan_remote_url }}
# secrets:
# conan_username: ${{ secrets.CONAN_USERNAME }}
# conan_password: ${{ secrets.CONAN_PASSWORD }}
#
# windows:
# needs:
# - env-vars
# - check-clang-format
# - check-levelization
# uses: ./.github/workflows/build-windows.yml
# with:
# conan_remote_name: ${{ env.CONAN_REMOTE_NAME }}
# conan_remote_url: ${{ env.CONAN_REMOTE_URL }}
# conan_remote_name: ${{ needs.env-vars.outputs.conan_remote_name }}
# conan_remote_url: ${{ needs.env-vars.outputs.conan_remote_url }}
# secrets:
# conan_username: ${{ secrets.CONAN_USERNAME }}
# conan_password: ${{ secrets.CONAN_PASSWORD }}