From 58dd07bbdf04772a9f8cda1a006e941189627452 Mon Sep 17 00:00:00 2001 From: Bart Date: Thu, 21 Aug 2025 16:32:04 -0400 Subject: [PATCH] fix: Skip notify-clio when running in a fork, reorder config fields (#5712) This change will skip running the notify-clio job when a PR is created from a fork, and reorders the strategy matrix configuration fields so GitHub will more clearly show which configuration is running. --- .github/scripts/strategy-matrix/generate.py | 21 ++++++++++++--------- .github/workflows/build-test.yml | 2 +- .github/workflows/notify-clio.yml | 1 + 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.github/scripts/strategy-matrix/generate.py b/.github/scripts/strategy-matrix/generate.py index 42927b5ccd..0acdca8d4f 100644 --- a/.github/scripts/strategy-matrix/generate.py +++ b/.github/scripts/strategy-matrix/generate.py @@ -48,18 +48,18 @@ def generate_strategy_matrix(all: bool, architecture: list[dict], os: list[dict] skip = True if os['distro_version'] == 'bookworm': if f'{os['compiler_name']}-{os['compiler_version']}' == 'gcc-13' and build_type == 'Release' and '-Dunity=ON' in cmake_args and architecture['platform'] == 'linux/arm64': - cmake_args = f'{cmake_args} -DUNIT_TEST_REFERENCE_FEE=500' + cmake_args = f'-DUNIT_TEST_REFERENCE_FEE=500 {cmake_args}' skip = False if f'{os['compiler_name']}-{os['compiler_version']}' == 'gcc-15' and build_type == 'Debug' and '-Dunity=OFF' in cmake_args and architecture['platform'] == 'linux/amd64': - cmake_args = f'{cmake_args} -Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0' + cmake_args = f'-Dcoverage=ON -Dcoverage_format=xml -DCODE_COVERAGE_VERBOSE=ON -DCMAKE_C_FLAGS=-O0 -DCMAKE_CXX_FLAGS=-O0 {cmake_args}' cmake_target = 'coverage' build_only = True skip = False if f'{os['compiler_name']}-{os['compiler_version']}' == 'clang-16' and build_type == 'Debug' and '-Dunity=OFF' in cmake_args and architecture['platform'] == 'linux/arm64': - cmake_args = f'{cmake_args} -Dvoidstar=ON' + cmake_args = f'-Dvoidstar=ON {cmake_args}' skip = False if f'{os['compiler_name']}-{os['compiler_version']}' == 'clang-17' and build_type == 'Release' and '-Dunity=ON' in cmake_args and architecture['platform'] == 'linux/amd64': - cmake_args = f'{cmake_args} -DUNIT_TEST_REFERENCE_FEE=1000' + cmake_args = f'-DUNIT_TEST_REFERENCE_FEE=1000 {cmake_args}' skip = False if f'{os['compiler_name']}-{os['compiler_version']}' == 'clang-20' and build_type == 'Debug' and '-Dunity=ON' in cmake_args and architecture['platform'] == 'linux/amd64': skip = False @@ -137,14 +137,17 @@ def generate_strategy_matrix(all: bool, architecture: list[dict], os: list[dict] if '-Dunity=ON' in cmake_args: config_name += '-unity' + # Add the configuration to the list, with the most unique fields first, + # so that they are easier to identify in the GitHub Actions UI, as long + # names get truncated. configurations.append({ - 'architecture': architecture, - 'os': os, - 'build_type': build_type, - 'build_only': 'true' if build_only else 'false', + 'config_name': config_name, 'cmake_args': cmake_args, 'cmake_target': cmake_target, - 'config_name': config_name, + 'build_only': 'true' if build_only else 'false', + 'build_type': build_type, + 'os': os, + 'architecture': architecture, }) return {'include': configurations} diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 2fa557f671..e06ff9abab 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -138,7 +138,7 @@ jobs: if: ${{ inputs.os == 'macos' }} run: | echo 'Installing build tools.' - brew install cmake conan ninja coreutils + brew install --quiet cmake conan ninja coreutils - name: Check configuration (Linux and MacOS) if: ${{ inputs.os == 'linux' || inputs.os == 'macos' }} run: | diff --git a/.github/workflows/notify-clio.yml b/.github/workflows/notify-clio.yml index 6ccf527ea6..b92dea65e2 100644 --- a/.github/workflows/notify-clio.yml +++ b/.github/workflows/notify-clio.yml @@ -36,6 +36,7 @@ defaults: jobs: upload: + if: ${{ github.event.pull_request.head.repo.full_name == github.repository }} runs-on: ubuntu-latest container: ghcr.io/xrplf/ci/ubuntu-noble:gcc-13 steps: