Skip to content

Commit

Permalink
build: add dry run
Browse files Browse the repository at this point in the history
  • Loading branch information
anwayde committed Dec 30, 2024
1 parent 18be65e commit f5f6408
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
9 changes: 9 additions & 0 deletions contrib/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit f5f6408

Please sign in to comment.