Builds #39
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Builds for all compilers, architectures and targets | |
name: Builds | |
on: | |
workflow_call: | |
inputs: | |
gcc: | |
type: string | |
description: GCC versions to use | |
default: all | |
clang: | |
type: string | |
description: Clang versions to use | |
default: all | |
machine: | |
type: string | |
description: Machines to build for | |
default: all | |
gcc_exceptions: | |
type: string | |
description: Exception groups for gcc | |
default: none | |
clang_exceptions: | |
type: string | |
description: Exception groups for clang | |
default: none | |
dry_run: | |
type: boolean | |
description: Print build matrix and exit | |
default: false | |
verbose: | |
type: boolean | |
description: Show error outputs | |
default: false | |
exit_on_err: | |
type: boolean | |
description: Exit on the first error | |
default: false | |
workflow_dispatch: | |
inputs: | |
gcc: | |
type: string | |
description: GCC versions to use (comma-separated | none | all) | |
default: all | |
clang: | |
type: string | |
description: Clang versions to use (comma-separated | none | all) | |
default: all | |
machine: | |
type: string | |
description: Machines to build for (comma-separated | all) | |
default: all | |
gcc_exceptions: | |
type: string | |
description: Exception groups for gcc (comma-separated and semi-colon delimited | none) | |
default: none | |
clang_exceptions: | |
type: string | |
description: Exception groups for clang (comma-separated and semi-colon delimited | none) | |
default: none | |
dry_run: | |
type: boolean | |
description: Print build matrix and exit | |
default: false | |
verbose: | |
type: boolean | |
description: Show error outputs | |
default: false | |
exit_on_err: | |
type: boolean | |
description: Exit on the first error | |
default: false | |
concurrency: | |
group: builds_${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build_gcc: | |
runs-on: X64 | |
if: ${{ inputs.gcc != 'none' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: dtolnay/[email protected] | |
- name: Build command line args | |
run: | | |
ARGS="" | |
# dry-run | |
if [ "${{ inputs.dry_run }}" == "true" ]; then | |
ARGS="$ARGS --dry-run" | |
fi | |
# verbose | |
if [ "${{ inputs.verbose }}" == "true" ]; then | |
ARGS="$ARGS --verbose" | |
fi | |
# exit-on-err | |
if [ "${{ inputs.exit_on_err }}" == "true" ]; then | |
ARGS="$ARGS --exit-on-err" | |
fi | |
# machine | |
if [ ! -z "${{ inputs.machine }}" ] && [ "${{ inputs.machine }}" != "all" ]; then | |
ARGS="$ARGS --machines ${{ inputs.machine }}" | |
fi | |
# gcc | |
if [ ! -z "${{ inputs.gcc }}" ] && [ "${{ inputs.gcc }}" != "all" ]; then | |
ARGS="$ARGS --gcc-versions ${{ inputs.gcc }}" | |
fi | |
# exceptions | |
if [ ! -z "${{ inputs.gcc_exceptions }}" ] && [ "${{ inputs.gcc_exceptions }}" != "none" ]; then | |
no_spaces=$(tr -d '[:space:]' <<< "${{ inputs.gcc_exceptions }}") | |
IFS=';' read -r -a exceptions <<< "$no_spaces" | |
for exception in ${exceptions[@]}; do | |
ARGS="$ARGS --gcc-except $exception" | |
done | |
fi | |
echo "BUILD_ARGS=$ARGS" >> $GITHUB_ENV | |
- name: Run gcc builds | |
run: | | |
contrib/build.sh --no-rust --no-clang ${{ env.BUILD_ARGS }} | |
build_clang: | |
runs-on: 512G | |
if: ${{ inputs.clang != 'none' }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: dtolnay/[email protected] | |
- name: Build command line args | |
run: | | |
ARGS="" | |
# dry-run | |
if [ "${{ inputs.dry_run }}" == "true" ]; then | |
ARGS="$ARGS --dry-run" | |
fi | |
# verbose | |
if [ "${{ inputs.verbose }}" == "true" ]; then | |
ARGS="$ARGS --verbose" | |
fi | |
# exit-on-err | |
if [ "${{ inputs.exit_on_err }}" == "true" ]; then | |
ARGS="$ARGS --exit-on-err" | |
fi | |
# machine | |
if [ ! -z "${{ inputs.machine }}" ] && [ "${{ inputs.machine }}" != "all" ]; then | |
ARGS="$ARGS --machines ${{ inputs.machine }}" | |
fi | |
# clang | |
if [ ! -z "${{ inputs.clang }}" ] && [ "${{ inputs.clang }}" != "all" ]; then | |
ARGS="$ARGS --clang-versions ${{ inputs.clang }}" | |
fi | |
# exceptions | |
if [ ! -z "${{ inputs.clang_exceptions }}" ] && [ "${{ inputs.clang_exceptions }}" != "none" ]; then | |
no_spaces=$(tr -d '[:space:]' <<< "${{ inputs.clang_exceptions }}") | |
IFS=';' read -r -a exceptions <<< "$no_spaces" | |
for exception in ${exceptions[@]}; do | |
ARGS="$ARGS --clang-except $exception" | |
done | |
fi | |
echo "BUILD_ARGS=$ARGS" >> $GITHUB_ENV | |
- name: Run clang builds | |
run: | | |
contrib/build.sh --no-rust --no-gcc ${{ env.BUILD_ARGS }} |