mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
Compare commits
3 Commits
copilot/re
...
legleux/tr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8585055d6e | ||
|
|
a35308399d | ||
|
|
8068a7b513 |
28
.github/scripts/strategy-matrix/generate.py
vendored
28
.github/scripts/strategy-matrix/generate.py
vendored
@@ -32,10 +32,13 @@ We will further set additional CMake arguments as follows:
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
|
|
||||||
def generate_strategy_matrix(all: bool, config: Config) -> list:
|
def generate_strategy_matrix(all: bool, config: Config, distro: str = "") -> list:
|
||||||
configurations = []
|
configurations = []
|
||||||
|
os_entries = config.os
|
||||||
|
if distro:
|
||||||
|
os_entries = [o for o in os_entries if o["distro_name"] == distro]
|
||||||
for architecture, os, build_type, cmake_args in itertools.product(
|
for architecture, os, build_type, cmake_args in itertools.product(
|
||||||
config.architecture, config.os, config.build_type, config.cmake_args
|
config.architecture, os_entries, config.build_type, config.cmake_args
|
||||||
):
|
):
|
||||||
# The default CMake target is 'all' for Linux and MacOS and 'install'
|
# The default CMake target is 'all' for Linux and MacOS and 'install'
|
||||||
# for Windows, but it can get overridden for certain configurations.
|
# for Windows, but it can get overridden for certain configurations.
|
||||||
@@ -223,7 +226,7 @@ def generate_strategy_matrix(all: bool, config: Config) -> list:
|
|||||||
if (n := os["compiler_version"]) != "":
|
if (n := os["compiler_version"]) != "":
|
||||||
config_name += f"-{n}"
|
config_name += f"-{n}"
|
||||||
config_name += (
|
config_name += (
|
||||||
f"-{architecture['platform'][architecture['platform'].find('/')+1:]}"
|
f"-{architecture['platform'][architecture['platform'].find('/') + 1 :]}"
|
||||||
)
|
)
|
||||||
config_name += f"-{build_type.lower()}"
|
config_name += f"-{build_type.lower()}"
|
||||||
if "-Dcoverage=ON" in cmake_args:
|
if "-Dcoverage=ON" in cmake_args:
|
||||||
@@ -313,21 +316,32 @@ if __name__ == "__main__":
|
|||||||
required=False,
|
required=False,
|
||||||
type=Path,
|
type=Path,
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"-d",
|
||||||
|
"--distro",
|
||||||
|
help="Filter OS entries to only include those with this distro_name (e.g. 'debian', 'rhel', 'ubuntu').",
|
||||||
|
required=False,
|
||||||
|
type=str,
|
||||||
|
default="",
|
||||||
|
)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
matrix = []
|
matrix = []
|
||||||
if args.config is None or args.config == "":
|
if args.config is None or args.config == "":
|
||||||
matrix += generate_strategy_matrix(
|
matrix += generate_strategy_matrix(
|
||||||
args.all, read_config(THIS_DIR / "linux.json")
|
args.all, read_config(THIS_DIR / "linux.json"), args.distro
|
||||||
)
|
)
|
||||||
matrix += generate_strategy_matrix(
|
matrix += generate_strategy_matrix(
|
||||||
args.all, read_config(THIS_DIR / "macos.json")
|
args.all, read_config(THIS_DIR / "macos.json"), args.distro
|
||||||
)
|
)
|
||||||
matrix += generate_strategy_matrix(
|
matrix += generate_strategy_matrix(
|
||||||
args.all, read_config(THIS_DIR / "windows.json")
|
args.all, read_config(THIS_DIR / "windows.json"), args.distro
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
matrix += generate_strategy_matrix(args.all, read_config(args.config))
|
matrix += generate_strategy_matrix(
|
||||||
|
args.all, read_config(args.config), args.distro
|
||||||
|
)
|
||||||
|
|
||||||
# Generate the strategy matrix.
|
# Generate the strategy matrix.
|
||||||
print(f"matrix={json.dumps({'include': matrix})}")
|
print(f"matrix={json.dumps({'include': matrix})}")
|
||||||
|
# print(json.dumps(matrix, indent=2))
|
||||||
|
|||||||
13
.github/workflows/on-pr.yml
vendored
13
.github/workflows/on-pr.yml
vendored
@@ -128,12 +128,23 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: [linux, macos, windows]
|
include:
|
||||||
|
- os: linux
|
||||||
|
distro: debian
|
||||||
|
- os: linux
|
||||||
|
distro: rhel
|
||||||
|
- os: linux
|
||||||
|
distro: ubuntu
|
||||||
|
- os: macos
|
||||||
|
distro: ""
|
||||||
|
- os: windows
|
||||||
|
distro: ""
|
||||||
with:
|
with:
|
||||||
# Enable ccache only for events targeting the XRPLF repository, since
|
# Enable ccache only for events targeting the XRPLF repository, since
|
||||||
# other accounts will not have access to our remote cache storage.
|
# other accounts will not have access to our remote cache storage.
|
||||||
ccache_enabled: ${{ github.repository_owner == 'XRPLF' }}
|
ccache_enabled: ${{ github.repository_owner == 'XRPLF' }}
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
distro: ${{ matrix.distro }}
|
||||||
secrets:
|
secrets:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
|
|||||||
13
.github/workflows/on-trigger.yml
vendored
13
.github/workflows/on-trigger.yml
vendored
@@ -77,7 +77,17 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: ${{ github.event_name == 'merge_group' }}
|
fail-fast: ${{ github.event_name == 'merge_group' }}
|
||||||
matrix:
|
matrix:
|
||||||
os: [linux, macos, windows]
|
include:
|
||||||
|
- os: linux
|
||||||
|
distro: debian
|
||||||
|
- os: linux
|
||||||
|
distro: rhel
|
||||||
|
- os: linux
|
||||||
|
distro: ubuntu
|
||||||
|
- os: macos
|
||||||
|
distro: ""
|
||||||
|
- os: windows
|
||||||
|
distro: ""
|
||||||
with:
|
with:
|
||||||
# Enable ccache only for events targeting the XRPLF repository, since
|
# Enable ccache only for events targeting the XRPLF repository, since
|
||||||
# other accounts will not have access to our remote cache storage.
|
# other accounts will not have access to our remote cache storage.
|
||||||
@@ -86,6 +96,7 @@ jobs:
|
|||||||
# not identical to a regular compilation.
|
# not identical to a regular compilation.
|
||||||
ccache_enabled: ${{ github.repository_owner == 'XRPLF' && !startsWith(github.ref, 'refs/heads/release') }}
|
ccache_enabled: ${{ github.repository_owner == 'XRPLF' && !startsWith(github.ref, 'refs/heads/release') }}
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
|
distro: ${{ matrix.distro }}
|
||||||
strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
|
strategy_matrix: ${{ github.event_name == 'schedule' && 'all' || 'minimal' }}
|
||||||
secrets:
|
secrets:
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|||||||
8
.github/workflows/reusable-build-test.yml
vendored
8
.github/workflows/reusable-build-test.yml
vendored
@@ -26,6 +26,12 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
default: "minimal"
|
default: "minimal"
|
||||||
|
|
||||||
|
distro:
|
||||||
|
description: 'Filter to only include configs for this distro (e.g. "debian", "rhel", "ubuntu"). Leave empty for no filtering.'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
|
||||||
secrets:
|
secrets:
|
||||||
CODECOV_TOKEN:
|
CODECOV_TOKEN:
|
||||||
description: "The Codecov token to use for uploading coverage reports."
|
description: "The Codecov token to use for uploading coverage reports."
|
||||||
@@ -38,9 +44,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
os: ${{ inputs.os }}
|
os: ${{ inputs.os }}
|
||||||
strategy_matrix: ${{ inputs.strategy_matrix }}
|
strategy_matrix: ${{ inputs.strategy_matrix }}
|
||||||
|
distro: ${{ inputs.distro }}
|
||||||
|
|
||||||
# Build and test the binary for each configuration.
|
# Build and test the binary for each configuration.
|
||||||
build-test-config:
|
build-test-config:
|
||||||
|
name: ${{ matrix.config_name }}
|
||||||
needs:
|
needs:
|
||||||
- generate-matrix
|
- generate-matrix
|
||||||
uses: ./.github/workflows/reusable-build-test-config.yml
|
uses: ./.github/workflows/reusable-build-test-config.yml
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: "minimal"
|
default: "minimal"
|
||||||
|
distro:
|
||||||
|
description: 'Filter to only include configs for this distro (e.g. "debian", "rhel", "ubuntu"). Leave empty for no filtering.'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
outputs:
|
outputs:
|
||||||
matrix:
|
matrix:
|
||||||
description: "The generated strategy matrix."
|
description: "The generated strategy matrix."
|
||||||
@@ -42,4 +47,5 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
|
GENERATE_CONFIG: ${{ inputs.os != '' && format('--config={0}.json', inputs.os) || '' }}
|
||||||
GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
|
GENERATE_OPTION: ${{ inputs.strategy_matrix == 'all' && '--all' || '' }}
|
||||||
run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} >> "${GITHUB_OUTPUT}"
|
GENERATE_DISTRO: ${{ inputs.distro != '' && format('--distro={0}', inputs.distro) || '' }}
|
||||||
|
run: ./generate.py ${GENERATE_OPTION} ${GENERATE_CONFIG} ${GENERATE_DISTRO} >> "${GITHUB_OUTPUT}"
|
||||||
|
|||||||
Reference in New Issue
Block a user