diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0fcbda8..214bd19 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,11 +42,13 @@ jobs: run: | lcommit=${{ github.event.pull_request.base.sha || 'origin/main' }} - # If we are on main, if workflow/cargo config files changed, or if - # the latest commit message contains "#build-all", run everything. - # Use #build-all in a commit message to force a full build on a PR - # branch (useful for testing release builds without merging to main). - if [ ${GITHUB_REF} = 'refs/heads/main' ] || git diff --name-only $lcommit..HEAD | grep -qe ^.github/workflows/ -e ^.cargo || git log -1 --format='%s %b' | grep -qF '#build-all' + # We rebuild everything if any of these conditions hold: + # * We are on main + # * Changes are made to github workflows + # * A cargo-workspace file changed (lockfile or .cargo), as that could affect any crate anywhere + # * Something from the script or dist folder changed (could be gated to installer, but some scripts like build_wpa_supplicant are part of the build process) + # * #build-all was used by the user to explicitly ask for this + if [ ${GITHUB_REF} = 'refs/heads/main' ] || git diff --name-only $lcommit..HEAD | grep -qe ^.github/workflows/ -e ^.cargo -e '^Cargo\.lock$' -e '^Cargo\.toml$' -e ^dist/ -e ^scripts/ || git log -1 --format='%s %b' | grep -qF '#build-all' then echo "building everything" echo code_count=forced >> "$GITHUB_OUTPUT"