Skip to content

Commit

Permalink
Run the test tasks on different jobs and combine the results
Browse files Browse the repository at this point in the history
This reduces the build time by about 2 hours!
  • Loading branch information
ben-manes committed May 22, 2022
1 parent 5d8a2fc commit d8e8a30
Show file tree
Hide file tree
Showing 26 changed files with 376 additions and 330 deletions.
89 changes: 50 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Runs the test suite on arm64 to verify correctness on a weaker memory model compared to x86's
version: 2.1

parameters:
Expand Down Expand Up @@ -87,68 +88,78 @@ commands:
cache_key: << parameters.cache_key >>

jobs:
strong_keys:
compile:
resource_class: arm.medium
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2004:current
environment:
JAVA_VERSION: << pipeline.parameters.java_version >>
TERM: dumb
steps:
- run_tests:
cache_key: strong_keys
cache_key: compile
test_steps:
- run:
name: Run tests
name: Compile
no_output_timeout: 1h
command: ./.github/scripts/test.sh --caffeine=strongKeys
- run:
name: Stop Gradle daemon
when: always
command: ./gradlew --stop
weak_keys:
command: ./gradlew check -x test
test:
resource_class: arm.medium
machine:
image: ubuntu-2004:202101-01
environment:
JAVA_VERSION: << pipeline.parameters.java_version >>
TERM: dumb
steps:
- run_tests:
cache_key: weak_keys
test_steps:
- run:
name: Run tests
no_output_timeout: 1h
command: ./.github/scripts/test.sh --caffeine=weakKeys
- run:
name: Stop Gradle daemon
when: always
command: ./gradlew --stop
isolated:
resource_class: arm.medium
machine:
image: ubuntu-2004:202101-01
image: ubuntu-2004:current
environment:
JAVA_VERSION: << pipeline.parameters.java_version >>
TERM: dumb
parameters:
task:
type: string
steps:
- run_tests:
cache_key: isolated
cache_key: << parameters.task >>
test_steps:
- run:
name: Run tests
no_output_timeout: 1h
command: ./.github/scripts/test.sh --caffeine=check
- run:
name: Stop Gradle daemon
when: always
command: ./gradlew --stop
command: ./gradlew << parameters.task >>

workflows:
version: 2
workflow:
jobs:
- strong_keys
- weak_keys
- isolated
- compile
- test:
requires: [compile]
matrix:
parameters:
task:
- caffeine:weakKeysAndStrongValuesStatsAsyncCaffeineSlowTest
- caffeine:weakKeysAndStrongValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndSoftValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsAsyncCaffeineTest
- caffeine:weakKeysAndWeakValuesStatsSyncCaffeineSlowTest
- caffeine:weakKeysAndSoftValuesStatsSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesStatsAsyncCaffeineTest
- caffeine:weakKeysAndStrongValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesAsyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesStatsSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndWeakValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndSoftValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndWeakValuesStatsSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesStatsSyncCaffeineTest
- caffeine:strongKeysAndStrongValuesAsyncCaffeineTest
- caffeine:weakKeysAndWeakValuesSyncCaffeineSlowTest
- caffeine:weakKeysAndSoftValuesSyncCaffeineSlowTest
- caffeine:strongKeysAndStrongValuesSyncCaffeineTest
- caffeine:weakKeysAndStrongValuesAsyncCaffeineTest
- caffeine:weakKeysAndStrongValuesSyncCaffeineTest
- caffeine:strongKeysAndWeakValuesSyncCaffeineTest
- caffeine:strongKeysAndSoftValuesSyncCaffeineTest
- caffeine:weakKeysAndWeakValuesSyncCaffeineTest
- caffeine:weakKeysAndSoftValuesSyncCaffeineTest
- caffeine:lincheckTest
- caffeine:isolatedTest
- caffeine:junitTest
2 changes: 2 additions & 0 deletions .codecov
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coverage:
round: nearest
104 changes: 0 additions & 104 deletions .github/scripts/test.sh

This file was deleted.

5 changes: 5 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ permissions: read-all
on: [ push, pull_request ]

env:
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

jobs:
Expand All @@ -14,6 +15,10 @@ jobs:
env:
JAVA_VERSION: ${{ matrix.java }}
steps:
- name: Harden Runner
uses: step-security/harden-runner@248ae51c2e8cc9622ecf50685c8bf7150c6e8813
with:
egress-policy: audit
- uses: actions/checkout@v3
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
Expand Down
Loading

0 comments on commit d8e8a30

Please sign in to comment.