Skip to content

Commit

Permalink
ci: add db matrix to ci
Browse files Browse the repository at this point in the history
  • Loading branch information
thesimplekid committed Sep 21, 2024
1 parent 4a0637a commit 3413c24
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ jobs:
[
-p cdk-integration-tests,
]
database:
[
REDB,
SQLITE,
MEMORY
]
steps:
- name: checkout
uses: actions/checkout@v4
Expand All @@ -95,7 +101,7 @@ jobs:
- name: Clippy
run: nix develop -i -L .#stable --command cargo clippy ${{ matrix.build-args }} -- -D warnings
- name: Test
run: nix develop -i -L .#stable --command just itest
run: nix develop -i -L .#stable --command just itest ${{ matrix.database }}

msrv-build:
name: "MSRV build"
Expand Down
2 changes: 1 addition & 1 deletion crates/cdk-integration-tests/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ async fn main() -> Result<()> {
let redb_db = MintRedbDatabase::new(&get_temp_dir().join("mint")).unwrap();
start_cln_mint(addr, port, redb_db).await?;
}
_ => panic!("Unknown mint db type"),
_ => panic!("Unknown mint db type: {}", mint_db_kind),
};

Ok(())
Expand Down
5 changes: 1 addition & 4 deletions misc/itests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [[ ! -d "$cdk_itests" ]]; then
fi

echo "Temp directory created: $cdk_itests"
export MINT_DATABASE="SQLITE";
export MINT_DATABASE="$1";

cargo build -p cdk-integration-tests
cargo build --bin cdk-integration-tests
Expand Down Expand Up @@ -86,8 +86,5 @@ cargo test -p cdk-integration-tests --test regtest
# Capture the exit status of cargo test
test_status=$?

# Source PIDs from file
source "$cdk_itests/pids.txt"

# Exit with the status of the tests
exit $test_status
4 changes: 2 additions & 2 deletions misc/test.just
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
itest:
itest db:
#!/usr/bin/env bash
./misc/itests.sh
./misc/itests.sh "{{db}}"

0 comments on commit 3413c24

Please sign in to comment.