Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
71e42686
You need to sign in or sign up before continuing.
Unverified
Commit
71e42686
authored
Sep 17, 2024
by
Daniël de Kok
Committed by
GitHub
Sep 17, 2024
Browse files
nix: pure Rust check/fmt/clippy/test (#2525)
Runs the tests in a Nix build sandbox.
parent
38fcafcf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
1 deletion
+23
-1
.github/workflows/nix_tests.yaml
.github/workflows/nix_tests.yaml
+1
-1
flake.nix
flake.nix
+22
-0
No files found.
.github/workflows/nix_tests.yaml
View file @
71e42686
...
@@ -38,4 +38,4 @@ jobs:
...
@@ -38,4 +38,4 @@ jobs:
env
:
env
:
HF_TOKEN
:
${{ secrets.HF_TOKEN }}
HF_TOKEN
:
${{ secrets.HF_TOKEN }}
-
name
:
Rust tests.
-
name
:
Rust tests.
run
:
nix
develop .#test --command cargo test
run
:
nix
build .#checks.$(nix eval --impure --raw --expr 'builtins.currentSystem').rust -L
flake.nix
View file @
71e42686
...
@@ -69,7 +69,29 @@
...
@@ -69,7 +69,29 @@
server
=
pkgs
.
python3
.
pkgs
.
callPackage
./nix/server.nix
{
inherit
nix-filter
;
};
server
=
pkgs
.
python3
.
pkgs
.
callPackage
./nix/server.nix
{
inherit
nix-filter
;
};
in
in
{
{
checks
=
{
rust
=
with
pkgs
;
rustPlatform
.
buildRustPackage
{
name
=
"rust-checks"
;
src
=
./.
;
cargoLock
=
{
lockFile
=
./Cargo.lock
;
};
buildInputs
=
[
openssl
.
dev
];
nativeBuildInputs
=
[
clippy
pkg-config
protobuf
python3
rustfmt
];
buildPhase
=
''
cargo check
''
;
checkPhase
=
''
cargo fmt -- --check
cargo test -j $NIX_BUILD_CORES
cargo clippy
''
;
installPhase
=
"touch $out"
;
}
;
};
formatter
=
pkgs
.
nixfmt-rfc-style
;
formatter
=
pkgs
.
nixfmt-rfc-style
;
devShells
=
with
pkgs
;
rec
{
devShells
=
with
pkgs
;
rec
{
default
=
pure
;
default
=
pure
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment