-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1621 from eqlabs/ci
ci: periodically refresh cache
- Loading branch information
Showing
1 changed file
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,9 @@ on: | |
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
# Daily cron job used to clear and rebuild cache (https://github.com/Swatinem/rust-cache/issues/181). | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
# Limits workflow concurrency to only the latest commit in the PR. | ||
concurrency: | ||
|
@@ -36,8 +39,15 @@ jobs: | |
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
- uses: Noelware/[email protected] | ||
- uses: taiki-e/install-action@nextest | ||
- name: Clear cache | ||
if: github.event_name =='schedule' | ||
run: | | ||
cargo clean | ||
rm -rf ~/.cargo/registry | ||
rm -rf ~/.cargo/git | ||
- name: Compile unit tests | ||
run: cargo nextest run --all-targets --all-features --workspace --locked --no-run --timings | ||
# --build-jobs 1 as we are constantly OOMing during compilation. | ||
run: cargo nextest run --all-targets --all-features --workspace --locked --no-run --timings --build-jobs 1 | ||
- name: Run unit tests | ||
run: timeout 10m cargo nextest run --no-fail-fast --all-targets --all-features --workspace --locked | ||
- name: Store timings | ||
|
@@ -58,6 +68,12 @@ jobs: | |
with: | ||
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
- uses: Noelware/[email protected] | ||
- name: Clear cache | ||
if: github.event_name =='schedule' | ||
run: | | ||
cargo clean | ||
rm -rf ~/.cargo/registry | ||
rm -rf ~/.cargo/git | ||
- run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings -D rust_2018_idioms | ||
|
||
rustfmt: | ||
|
@@ -80,6 +96,9 @@ jobs: | |
with: | ||
save-if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} | ||
- uses: Noelware/[email protected] | ||
- name: Clear cache | ||
if: github.event_name =='schedule' | ||
run: cargo clean | ||
- run: cargo doc --no-deps --document-private-items | ||
|
||
dep-sort: | ||
|