Browse Source

ci: add db matrix to ci

thesimplekid 5 months ago
parent
commit
3413c24936
4 changed files with 11 additions and 8 deletions
  1. 7 1
      .github/workflows/ci.yml
  2. 1 1
      crates/cdk-integration-tests/src/main.rs
  3. 1 4
      misc/itests.sh
  4. 2 2
      misc/test.just

+ 7 - 1
.github/workflows/ci.yml

@@ -83,6 +83,12 @@ jobs:
           [
             -p cdk-integration-tests,
           ]
+        database: 
+          [
+          REDB,
+          SQLITE,
+          MEMORY
+          ]
     steps:
       - name: checkout
         uses: actions/checkout@v4
@@ -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"

+ 1 - 1
crates/cdk-integration-tests/src/main.rs

@@ -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(())

+ 1 - 4
misc/itests.sh

@@ -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 
@@ -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

+ 2 - 2
misc/test.just

@@ -1,4 +1,4 @@
-itest:
+itest db:
   #!/usr/bin/env bash
-  ./misc/itests.sh
+  ./misc/itests.sh "{{db}}"