Skip to content

Commit 629b64a

Browse files
committed
Split Build And Test phases For Better Parallelization
1 parent 596a879 commit 629b64a

File tree

1 file changed

+34
-7
lines changed

1 file changed

+34
-7
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
3333
with:
3434
path: ~/.m2/repository
35-
key: tests-maven-${{ hashFiles('pom.xml') }}
35+
key: build-maven-${{ hashFiles('pom.xml') }}
3636

3737
- uses: s4u/maven-settings-action@64e42c454dbd42ef6370ac8539685755aedd205b # v3.1.0
3838
with:
@@ -45,8 +45,8 @@ jobs:
4545
languages: java
4646
queries: security-and-quality
4747

48-
- name: Download Ontology, Build and Run Tests
49-
run: mvn -P download-ontology -B verify
48+
- name: Download Ontology, Build Without Tests
49+
run: mvn -P download-ontology -B package -DskipTests
5050

5151
- name: Set up Docker Buildx
5252
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3
@@ -57,10 +57,6 @@ jobs:
5757
context: .
5858
tags: torch:latest
5959
outputs: type=docker,dest=/tmp/torch.tar
60-
61-
- name: Upload Coverage to Codecov
62-
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5
63-
6460
- name: Perform CodeQL Analysis
6561
uses: github/codeql-action/analyze@ff0a06e83cb2de871e5a09832bc6a81e7276941f # v3
6662

@@ -111,6 +107,36 @@ jobs:
111107
with:
112108
sarif_file: trivy-results.sarif
113109

110+
test:
111+
needs: build
112+
runs-on: ubuntu-24.04
113+
steps:
114+
- name: Check out Git repository
115+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
116+
117+
- name: Set up JDK 21
118+
uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4
119+
with:
120+
distribution: 'temurin'
121+
java-version: 21
122+
123+
- name: Cache Local Maven Repo
124+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4
125+
with:
126+
path: ~/.m2/repository
127+
key: tests-maven-${{ hashFiles('pom.xml') }}
128+
129+
- uses: s4u/maven-settings-action@64e42c454dbd42ef6370ac8539685755aedd205b # v3.1.0
130+
with:
131+
servers: |
132+
[{"id": "mii", "username": "${{ github.actor }}", "password": "${{ secrets.GITHUB_TOKEN }}"}]
133+
134+
- name: Download Ontology and Run Tests
135+
run: mvn -P download-ontology -B verify
136+
137+
- name: Upload Coverage to Codecov
138+
uses: codecov/codecov-action@18283e04ce6e62d37312384ff67231eb8fd56d24 # v5
139+
114140
blackbox-integration-tests:
115141
needs: build
116142
runs-on: ubuntu-24.04
@@ -150,6 +176,7 @@ jobs:
150176

151177
push-image:
152178
needs:
179+
- test
153180
- image-scan
154181
- blackbox-integration-tests
155182
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)