Skip to content

Commit

Permalink
[ci] Test Git hooks (#919)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlf committed Feb 22, 2024
1 parent 8fa5a84 commit 65c080c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ jobs:
cargo install cargo-readme --version 3.2.0 &> /dev/null || true
cargo install --locked kani-verifier &> /dev/null || true
cargo kani setup &> /dev/null || true
check-all-toolchains-tested:
runs-on: ubuntu-latest
name: Check that all toolchains listed in Cargo.toml are tested in CI
Expand All @@ -431,6 +432,22 @@ jobs:
- name: Run dependency check
run: ./ci/check_job_dependencies.sh

run-git-hooks:
runs-on: ubuntu-latest
name: Run Git hooks
steps:
- name: Install yq (for YAML parsing)
run: go install github.com/mikefarah/yq/v4@latest
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run dependency check
# Ensure that Git hooks execute successfully.
#
# Note that this runs all hooks. As of this writing, the only Git hook
# is `pre-push`. Running all hooks ensures that, if a new hook is added
# which can't run in CI (at least not using this naive setup), we'll
# notice and it will remind us to update this test.
run: set -e; for hook in ./githooks/*; do $hook; done

# Used to signal to branch protections that all other jobs have succeeded.
all-jobs-succeed:
name: All checks succeeded
Expand All @@ -441,7 +458,7 @@ jobs:
# https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/troubleshooting-required-status-checks#handling-skipped-but-required-checks
if: failure()
runs-on: ubuntu-latest
needs: [build_test, kani, check_fmt, check_readme, check_msrv, check_versions, generate_cache, check-all-toolchains-tested, check-job-dependencies]
needs: [build_test, kani, check_fmt, check_readme, check_msrv, check_versions, generate_cache, check-all-toolchains-tested, check-job-dependencies, run-git-hooks]
steps:
- name: Mark the job as failed
run: exit 1

0 comments on commit 65c080c

Please sign in to comment.