diff --git a/.github/workflows/message-queue-tests.yml b/.github/workflows/message-queue-tests.yml index 85a6ab7f..22758cbe 100644 --- a/.github/workflows/message-queue-tests.yml +++ b/.github/workflows/message-queue-tests.yml @@ -33,4 +33,4 @@ jobs: github-token: ${{ inputs.github-token }} - name: Run message-queue Docker tests - run: cd tests/message-queue && cargo test + run: cd tests/message-queue && GITHUB_CI=true cargo test diff --git a/.github/workflows/monero-tests.yaml b/.github/workflows/monero-tests.yaml index 7e6532e7..f05a0365 100644 --- a/.github/workflows/monero-tests.yaml +++ b/.github/workflows/monero-tests.yaml @@ -28,7 +28,7 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} - name: Run Unit Tests Without Features - run: cargo test --package monero-serai --lib + run: GITHUB_CI=true cargo test --package monero-serai --lib # Doesn't run unit tests with features as the tests workflow will @@ -51,11 +51,11 @@ jobs: - name: Run Integration Tests Without Features # Runs with the binaries feature so the binaries build # https://github.com/rust-lang/cargo/issues/8396 - run: cargo test --package monero-serai --features binaries --test '*' + run: GITHUB_CI=true cargo test --package monero-serai --features binaries --test '*' - name: Run Integration Tests # Don't run if the the tests workflow also will if: ${{ matrix.version != 'v0.18.2.0' }} run: | - cargo test --package monero-serai --all-features --test '*' - cargo test --package serai-processor --all-features monero + GITHUB_CI=true cargo test --package monero-serai --all-features --test '*' + GITHUB_CI=true cargo test --package serai-processor --all-features monero diff --git a/.github/workflows/processor-tests.yml b/.github/workflows/processor-tests.yml index 81a4fff1..1494bcf8 100644 --- a/.github/workflows/processor-tests.yml +++ b/.github/workflows/processor-tests.yml @@ -37,4 +37,4 @@ jobs: github-token: ${{ inputs.github-token }} - name: Run processor Docker tests - run: cd tests/processor && cargo test + run: cd tests/processor && GITHUB_CI=true cargo test diff --git a/tests/docker/src/lib.rs b/tests/docker/src/lib.rs index efb81b67..a09f3fbe 100644 --- a/tests/docker/src/lib.rs +++ b/tests/docker/src/lib.rs @@ -143,6 +143,20 @@ pub fn build(name: String) { println!("Built!"); + if std::env::var("GITHUB_CI").is_ok() { + println!("In CI, so clearing cache to prevent hitting the storage limits."); + Command::new("docker") + .arg("builder") + .arg("prune") + .arg("--all") + .arg("--force") + .output() + .unwrap(); + if !res.status.success() { + println!("failed to clear cache after building {name}\n"); + } + } + // Set built built_lock.insert(name, true); }