mirror of
https://github.com/serai-dex/serai.git
synced 2024-12-31 16:09:47 +00:00
Clear docker cache after building in CI
We're at the CI storage limits, so hopefully this helps.
This commit is contained in:
parent
61d46dccd4
commit
4949793c3f
4 changed files with 20 additions and 6 deletions
2
.github/workflows/message-queue-tests.yml
vendored
2
.github/workflows/message-queue-tests.yml
vendored
|
@ -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
|
||||
|
|
8
.github/workflows/monero-tests.yaml
vendored
8
.github/workflows/monero-tests.yaml
vendored
|
@ -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
|
||||
|
|
2
.github/workflows/processor-tests.yml
vendored
2
.github/workflows/processor-tests.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue