Skip to content
This repository has been archived by the owner on Dec 3, 2024. It is now read-only.

Commit

Permalink
Fix nix GitHub action (#253)
Browse files Browse the repository at this point in the history
* Fix nix github actions

- Use `nix develop`
- Check if pre-commit hooks work.
- Use `rust-cache`
- Remove unused git config

* Remove non-existant flake input override
  • Loading branch information
sveitser authored Aug 23, 2024
1 parent 2b5062b commit b9316d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
29 changes: 7 additions & 22 deletions .github/workflows/build_nix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,34 +14,19 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 90
steps:
- name: Configure Git
run: |
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com/".insteadOf git://github.com/
git config --global url."https://ancient123:${{ secrets.ORG_GITHUB_PAT }}@github.com/".insteadOf ssh://[email protected]/
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install Nix
uses: cachix/install-nix-action@v24

# - uses: cachix/cachix-action@v12
# with:
# name: espresso-systems-private
# authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: Swatinem/rust-cache@v2

- name: Cache cargo
uses: actions/[email protected]
with:
path: |
~/.cargo-nix/registry/index
~/.cargo-nix/registry/cache
~/.cargo-nix/git
target
key: espresso-nix-v2-${{ hashFiles('Cargo.lock') }}
- name: Nix environment loads
run: nix develop -c echo Success

- name: "Sanity Check: nix environment loads"
run: nix-shell --run "echo Success"
- name: Nix environment builds all targets
run: nix develop -c cargo build --all-targets --all-features --release --workspace

- name: "Sanity Check: nix environment builds all targets"
run: nix-shell --run "cargo build --all-targets --all-features --release --workspace"
- name: Precommit hooks work
run: nix develop -c pre-commit run --all-files
1 change: 0 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
inputs.rust-overlay.url = "github:oxalica/rust-overlay";

inputs.pre-commit-hooks.url = "github:cachix/pre-commit-hooks.nix";
inputs.pre-commit-hooks.inputs.flake-utils.follows = "flake-utils";
inputs.pre-commit-hooks.inputs.nixpkgs.follows = "nixpkgs";

outputs = { self, nixpkgs, flake-utils, rust-overlay, pre-commit-hooks, ... }:
Expand Down

0 comments on commit b9316d9

Please sign in to comment.