-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split building and testing in workflow
- Loading branch information
Showing
1 changed file
with
31 additions
and
3 deletions.
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 |
---|---|---|
|
@@ -19,17 +19,18 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: gradle/[email protected] | ||
|
||
gradle: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Gradle build, test and check | ||
- name: Gradle build without tests | ||
uses: ./.github/workflows/gradle-goal | ||
with: | ||
command: "./gradlew check" | ||
# We also compile the test-classes, even though we are skipping the tests | ||
command: "./gradlew build testClasses -x test" | ||
|
||
- name: Warmup gradle wrapper | ||
uses: ./.github/workflows/gradle-goal | ||
|
@@ -42,9 +43,36 @@ jobs: | |
name: test-results | ||
path: '**/build/test-results/test/TEST-*.xml' | ||
|
||
- name: Cache working directory with build results | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: working-dir-build-cache | ||
path: ./ | ||
|
||
- name: Agent artifact | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: elastic-otel-javaagent | ||
path: | | ||
./agent/build/libs/elastic-otel-javaagent-*.jar | ||
test: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
steps: | ||
- name: Download cached build working directory | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: working-dir-build-cache | ||
path: ./ | ||
- name: Run tests | ||
uses: ./.github/workflows/gradle-goal | ||
with: | ||
command: "./gradlew test" | ||
- name: Store test results | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-results | ||
path: '**/build/test-results/test/TEST-*.xml' |