Skip to content

Commit

Permalink
feat: remove precommit use in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Nov 15, 2024
1 parent e5c81d3 commit 03b4fa1
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 27 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
fail-mode: true

pre-commit-checks:
name: "Pre-commit checks: cargo fmt, typos"
name: "Cargo fmt, typos"
runs-on: ubuntu-latest
steps:
- name: checkout
Expand All @@ -32,8 +32,15 @@ jobs:
uses: DeterminateSystems/magic-nix-cache-action@v6
- name: Rust Cache
uses: Swatinem/rust-cache@v2
- name: Pre-commit checks
run: nix develop -i -L .#stable --command pre-commit run --all-files
- name: Cargo fmt
run: |
nix develop -i -L .#nightly --command bash -c '
# Force use of Nix-provided rustfmt
export RUSTFMT=$(command -v rustfmt)
cargo fmt --check
'
- name: typos
run: nix develop -i -L .#nightly --command typos

clippy:
name: "Stable build, clippy and test"
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
*.redb
*.sqlite*
config.toml
.pre-commit-config.yaml
1 change: 0 additions & 1 deletion .pre-commit-config.yaml

This file was deleted.

18 changes: 9 additions & 9 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 25 additions & 14 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
};

# Nighly for creating lock files
nightly_toolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default);
nightly_toolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default.override {
extensions = [ "rustfmt" ];
});

# Common inputs
envVars = { };
Expand All @@ -71,6 +73,9 @@
clightning
bitcoind
sqlx-cli

# Needed for github ci
libz
] ++ libsDarwin;

# WASM deps
Expand Down Expand Up @@ -146,32 +151,38 @@
} // envVars);

stable = pkgs.mkShell ({
shellHook = "${_shellHook}";
shellHook = ''${_shellHook}'';
buildInputs = buildInputs ++ WASMInputs ++ [ stable_toolchain ];
inherit nativeBuildInputs;
} // envVars);


db_shell = pkgs.mkShell ({
shellHook = "
${_shellHook}
cargo update -p half --precise 2.2.1
cargo update -p home --precise 0.5.5
cargo update -p tokio --precise 1.38.1
cargo update -p tokio-stream --precise 0.1.15
cargo update -p serde_with --precise 3.1.0
cargo update -p reqwest --precise 0.12.4
cargo update -p url --precise 2.5.2
cargo update -p allocator-api2 --precise 0.2.18
";
shellHook = ''
${_shellHook}
cargo update -p half --precise 2.2.1
cargo update -p home --precise 0.5.5
cargo update -p tokio --precise 1.38.1
cargo update -p tokio-stream --precise 0.1.15
cargo update -p serde_with --precise 3.1.0
cargo update -p reqwest --precise 0.12.4
cargo update -p url --precise 2.5.2
cargo update -p allocator-api2 --precise 0.2.18
'';
buildInputs = buildInputs ++ WASMInputs ++ [ db_msrv_toolchain ];
inherit nativeBuildInputs;
} // envVars);



nightly = pkgs.mkShell ({
shellHook = "${_shellHook}";
shellHook = ''
${_shellHook}
# Needed for github ci
export LD_LIBRARY_PATH=${pkgs.lib.makeLibraryPath [
pkgs.zlib
]}:$LD_LIBRARY_PATH
'';
buildInputs = buildInputs ++ [ nightly_toolchain ];
inherit nativeBuildInputs;
} // envVars);
Expand Down

0 comments on commit 03b4fa1

Please sign in to comment.