Skip to content

Commit

Permalink
Improve GA config (#1299)
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai authored Aug 22, 2023
1 parent 26cf890 commit 4f1ec04
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bench_run.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# PRs do not share caches, instead each PR initially pulls from the cache of the main branch for the first run.
# This workflow does not run on main, so to make use of a cache before this workflow has completed once on a PR,
# we need to manually recreate the key used by ubuntu-20.04 release builds.
shared-key: "ubuntu-20.04 - --release-build_and_test"
shared-key: "ubuntu-20.04 - --release-build_check_and_upload"
save-if: false
- name: cache custom ubuntu packages
uses: actions/cache@v3
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/build_and_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ jobs:
# Otherwise only the last build to finish would get saved to the cache.
# We allow different test_flags to share a cache as they should have identical build outputs
key: ${{ matrix.runner }} - ${{ matrix.cargo_flags }}
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/head/main' }}
- name: cache custom ubuntu packages
uses: actions/cache@v3
with:
Expand Down Expand Up @@ -83,9 +90,9 @@ jobs:
strategy:
fail-fast: false
matrix:
partition: [1, 2, 3, 4]
partition: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
profile: ["release", "debug"]
name: Test ${{ matrix.profile}} ${{ matrix.partition }}/4
name: Test ${{ matrix.profile}} ${{ matrix.partition }}/15
runs-on: ubuntu-20.04
needs: build_check_and_upload
steps:
Expand All @@ -107,7 +114,7 @@ jobs:
- name: Run tests
run: |
~/.cargo/bin/cargo-nextest nextest run --archive-file nextest-${{ matrix.profile }}.tar.zst \
--partition count:${{ matrix.partition }}/4 --extract-to . --run-ignored all
--partition count:${{ matrix.partition }}/15 --extract-to . --run-ignored all
- name: Cleanup archive
run: rm nextest-${{ matrix.profile }}.tar.zst
- name: Ensure that tests did not create or modify any files that arent .gitignore'd
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/windsock_benches.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: Swatinem/rust-cache@v2
with:
# this line means that only the main branch writes to the cache
# benefits:
# * prevents main branch caches from being evicted in favor of a PR cache
# * saves about 1min per workflow by skipping the actual cache write
# downsides:
# * PRs that update rust version or changes deps will be slow to iterate on due to changes not being cached.
save-if: ${{ github.ref == 'refs/head/main' }}
- name: Ensure that custom benches run
run: |
cargo windsock --bench-length-seconds 5 --operations-per-second 100
Expand Down

0 comments on commit 4f1ec04

Please sign in to comment.