Skip to content
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
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use nix
13 changes: 3 additions & 10 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,11 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Install Nix
uses: cachix/install-nix-action@v31

- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --verbose --release --target ${{ matrix.target }}
run: nix-shell --command "cargo build --verbose --release --target ${{ matrix.target }}"

- name: Strip binaries (Linux)
if: matrix.target == 'x86_64-unknown-linux-gnu'
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Rust
run: rustup update stable
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Generate code coverage
run: cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info
run: nix-shell --command "cargo llvm-cov --all-features --workspace --lcov --output-path lcov.info"
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
18 changes: 3 additions & 15 deletions .github/workflows/hooky.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,9 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: moonrepo/setup-rust@v1
- name: Download Hooky binary
id: download
run: |
TAG="v1.0.0"
ASSET="hooky-${TAG#v}-linux-x86_64"
URL="https://github.com/brandonchinn178/hooky/releases/download/${TAG}/${ASSET}"
echo "Downloading $URL"
sudo curl -L -o /usr/bin/hooky "${URL}"
sudo chmod +x /usr/bin/hooky
- name: Verify dependency versions
run: |
hooky --version
rustfmt --version
- name: Install Nix
uses: cachix/install-nix-action@v31
- name: Execute hooks
run: hooky run --all --format=verbose
run: nix-shell --command "hooky run --all --format=verbose"
env:
SKIP: no_commit_to_branch
23 changes: 23 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
let
nixpkgs = fetchTarball "https://github.com/NixOS/nixpkgs/archive/83e29f2b8791f6dec20804382fcd9a666d744c07.tar.gz";
pkgs = import nixpkgs { config = {}; overlays = []; };
in

pkgs.mkShell {
packages = with pkgs; [
hooky
cargo
cargo-llvm-cov
rustc
rustc.llvmPackages.llvm
rustfmt
clippy
rust-analyzer
sqlite
];

shellHook = ''
export LLVM_COV=${pkgs.llvm}/bin/llvm-cov
export LLVM_PROFDATA=${pkgs.llvm}/bin/llvm-profdata
'';
}
Loading