Skip to content

Commit

Permalink
ci(pre-commit): Install nix and use stackabletech/actions/run-pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Techassi committed Nov 15, 2024
1 parent fc0e372 commit bcc1f75
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions .github/workflows/pr_pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,10 @@ jobs:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0
- uses: cachix/install-nix-action@08dcb3a5e62fa31e2da3d490afc4176ef55ecd72 #v30
with:
python-version: '3.12'
- uses: dtolnay/rust-toolchain@master
github_access_token: ${{ secrets.GITHUB_TOKEN }}
- uses: stackabletech/actions/run-pre-commit@9bd13255f286e4b7a654617268abe1b2f37c3e0a # v0.3.0
with:
toolchain: ${{ env.RUST_TOOLCHAIN_VERSION }}
components: rustfmt,clippy
- name: Setup Hadolint
shell: bash
run: |
set -euo pipefail
LOCATION_DIR="$HOME/.local/bin"
LOCATION_BIN="$LOCATION_DIR/hadolint"
SYSTEM=$(uname -s)
ARCH=$(uname -m)
mkdir -p "$LOCATION_DIR"
curl -sL -o "${LOCATION_BIN}" "https://github.com/hadolint/hadolint/releases/download/${{ env.HADOLINT_VERSION }}/hadolint-$SYSTEM-$ARCH"
chmod 700 "${LOCATION_BIN}"
echo "$LOCATION_DIR" >> "$GITHUB_PATH"
- 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 }}"
rust: ${{ env.RUST_TOOLCHAIN_VERSION }}
hadolint: ${{ env.HADOLINT_VERSION }}

0 comments on commit bcc1f75

Please sign in to comment.