diff --git a/.github/workflows/builds.yml b/.github/workflows/builds.yml index 2b39a7204b..d7202eab68 100644 --- a/.github/workflows/builds.yml +++ b/.github/workflows/builds.yml @@ -18,6 +18,10 @@ on: type: string description: Machines to build for default: all + dry_run: + type: boolean + description: Print build matrix and exit + default: false verbose: type: boolean description: Show error outputs @@ -40,6 +44,10 @@ on: type: string description: Machines to build for (comma-separated | all) default: all + dry_run: + type: boolean + description: Print build matrix and exit + default: false verbose: type: boolean description: Show error outputs @@ -65,6 +73,10 @@ jobs: - 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" @@ -100,6 +112,10 @@ jobs: - 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" diff --git a/contrib/build.sh b/contrib/build.sh index 97e96042e4..d8573d9852 100755 --- a/contrib/build.sh +++ b/contrib/build.sh @@ -12,6 +12,7 @@ help() { echo " --no-clang Do not run any clang builds" echo " --no-deps Do not install deps during any builds" echo " --no-rust Do not install rust" + echo " --dry-run Print build matrix and exit" echo " --verbose Show output from failed builds" echo " --exit-on-err Exit upon hitting the first failed build" echo " --help -h Show this message and exit" @@ -96,6 +97,10 @@ while [[ $# -gt 0 ]]; do "--no-rust") NO_RUST=1 ;; + # print build matrix and exit + "--dry-run") + DRY_RUN=1 + ;; # exit upon hitting the first error "--exit-on-err") EXIT_ON_ERR=1 @@ -211,6 +216,10 @@ echo "gcc=[ ${GCC[*]} ]" echo "targets=[ ${TARGETS[*]} ]" echo +if [[ $DRY_RUN -eq 1 ]]; then + exit 0 +fi + # Install rust and packages, also fetch the git repositories # needed for compiling.