Skip to content

Commit

Permalink
ci(nix): add Docker to shell and test environments
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob committed Sep 19, 2024
1 parent a211452 commit d1ae01f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/jstzd/tests/dummy.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
use bollard::Docker;
use jstzd::main;

#[tokio::test]
async fn test_main() {
let docker = Docker::connect_with_socket_defaults().unwrap();
let version = docker.version().await.unwrap();
println!("{:?}", version);

main().await.unwrap();
}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@

# Code coverage
cargo-llvm-cov
docker
]
++ lib.optionals stdenv.isLinux [pkg-config openssl.dev]
++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [Security SystemConfiguration]);
Expand Down
4 changes: 4 additions & 0 deletions nix/crates.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ in {
jstz_rollup = crate "jstz_rollup";
inherit jstz_kernel;
jstz_wpt = crate "jstz_wpt";
jstzd = crate "jstzd";
octez = crate "octez";

# Special target to build all crates in the workspace
Expand All @@ -122,6 +123,8 @@ in {
cargo-test-int = craneLib.cargoNextest (commonWorkspace
// {
cargoArtifacts = cargoDeps;

buildInputs = commonWorkspace.buildInputs ++ [pkgs.docker];
# Run the integration tests
#
# FIXME():
Expand All @@ -134,6 +137,7 @@ in {
cargo-llvm-cov = craneLib.cargoLlvmCov (commonWorkspace
// {
cargoArtifacts = cargoDeps;
buildInputs = commonWorkspace.buildInputs ++ [pkgs.docker];
# Generate coverage reports for codecov
cargoLlvmCovExtraArgs = "--workspace --exclude-from-test \"jstz_api\" --codecov --output-path $out";
});
Expand Down

0 comments on commit d1ae01f

Please sign in to comment.