From 60551e94b5055198fffc711135f6e9a9d3a2698f Mon Sep 17 00:00:00 2001 From: Nick <10092581+NickLarsenNZ@users.noreply.github.com> Date: Fri, 20 Sep 2024 01:18:16 +1200 Subject: [PATCH] ci(pre-commit): Install dependencies needed for cargo test (#441) * Revert "fix(template): Run commands in a nix-shell to automatically pull the necessary dependencies" This reverts commit 56f72e07fe1e17a64c514c4d4b97e66e957b0f00. * ci(pre-commit): install dependencies needed for cargo test --- template/.github/workflows/pr_pre-commit.yaml.j2 | 6 +++++- template/.pre-commit-config.yaml.j2 | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/template/.github/workflows/pr_pre-commit.yaml.j2 b/template/.github/workflows/pr_pre-commit.yaml.j2 index 55cf98ed..e7aa2582 100644 --- a/template/.github/workflows/pr_pre-commit.yaml.j2 +++ b/template/.github/workflows/pr_pre-commit.yaml.j2 @@ -13,6 +13,11 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: + - name: Install host dependencies + uses: awalsh128/cache-apt-pkgs-action@a6c3917cc929dd0345bfb2d3feaf9101823370ad # v1.4.2 + with: + packages: protobuf-compiler krb5-user libkrb5-dev libclang-dev liblzma-dev libssl-dev pkg-config apt-transport-https + version: ubuntu-latest - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 with: fetch-depth: 0 @@ -40,7 +45,6 @@ jobs: chmod 700 "${LOCATION_BIN}" echo "$LOCATION_DIR" >> "$GITHUB_PATH" - - uses: cachix/install-nix-action@8887e596b4ee1134dae06b98d573bd674693f47c # v26 - uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1 with: extra_args: "--from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.event.pull_request.head.sha }}" diff --git a/template/.pre-commit-config.yaml.j2 b/template/.pre-commit-config.yaml.j2 index f30ef3ab..4b1c512f 100644 --- a/template/.pre-commit-config.yaml.j2 +++ b/template/.pre-commit-config.yaml.j2 @@ -66,13 +66,13 @@ repos: - id: regenerate-charts name: regenerate-charts language: system - entry: nix-shell --run 'make regenerate-charts' + entry: make regenerate-charts stages: [commit, merge-commit, manual] pass_filenames: false - id: cargo-test name: cargo-test language: system - entry: nix-shell --run 'cargo test' + entry: cargo test stages: [commit, merge-commit, manual] pass_filenames: false