Skip to content

ci(template): Install Nix in pre-commit workflow #516

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions config/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,10 @@ hadolint_version: v2.12.0
# If you change the Python version here, make sure to also change it in
# .github/workflows/pr_pre-commit.yml
python_version: 3.12

# This Nix version is used in the operators pre-commit workflow as they require
# Nix to run some checks. Check for new versions here:
# https://github.com/NixOS/nix/tags
# Usually the latest version should just work and as such the version here can
# be bumped without any constraints.
nix_pkg_manager_version: 2.28.3
3 changes: 3 additions & 0 deletions template/.github/workflows/pr_pre-commit.yaml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:

env:
CARGO_TERM_COLOR: always
NIX_PKG_MANAGER_VERSION: "{[ nix_pkg_manager_version }]"
RUST_TOOLCHAIN_VERSION: "{[ rust_nightly_version }]"
HADOLINT_VERSION: "{[ hadolint_version }]"
PYTHON_VERSION: "{[ python_version }]"
Expand All @@ -29,3 +30,5 @@ jobs:
python-version: ${{ env.PYTHON_VERSION }}
rust: ${{ env.RUST_TOOLCHAIN_VERSION }}
hadolint: ${{ env.HADOLINT_VERSION }}
nix: ${{ env.NIX_PKG_MANAGER_VERSION }}
nix-github-token: ${{ secrets.GITHUB_TOKEN }}