Skip to content

Commit 87f0852

Browse files
committed
ci: build all first, then run all
1 parent 3f276e1 commit 87f0852

File tree

2 files changed

+60
-30
lines changed

2 files changed

+60
-30
lines changed

.github/scripts/prevent_stale_fork.sh

Lines changed: 0 additions & 23 deletions
This file was deleted.

.github/workflows/performance_score_director.yml

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ on:
3333

3434
jobs:
3535

36-
benchmark:
36+
build:
3737
runs-on: self-hosted
3838
strategy:
39-
fail-fast: false # Jobs fail if the benchmark error is over predefined thresholds; other benchmarks continue.
39+
fail-fast: true # If one compilation fails, abort everything.
4040
matrix:
4141
example: [cloud_balancing, conference_scheduling, curriculum_course, examination, machine_reassignment, meeting_scheduling, nurse_rostering, patient_admission_scheduling, task_assigning, traveling_tournament, tsp, vehicle_routing]
4242
env:
@@ -74,6 +74,12 @@ jobs:
7474
mvn clean install -B -Dquickly -Dversion.ai.timefold.solver=${{ github.event.inputs.baseline }} -Dversion.tools.provider="${{ github.event.inputs.async_profiler_version }}"
7575
mv target/benchmarks.jar benchmarks-baseline.jar
7676
77+
- name: Phase 1 - (Baseline) Upload the binary
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: results-${{ matrix.example }}-${{ github.event.inputs.baseline }}_vs_${{ github.event.inputs.branch }}
81+
path: benchmarks-baseline.jar
82+
7783
- name: Phase 1 - (SUT) Checkout timefold-solver
7884
uses: actions/checkout@v4
7985
with:
@@ -117,8 +123,43 @@ jobs:
117123
mvn clean install -B -Dquickly -Dversion.tools.provider="${{ github.event.inputs.async_profiler_version }}"
118124
mv target/benchmarks.jar benchmarks-sut.jar
119125
126+
- name: Phase 1 - (SUT) Upload the binary
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: results-${{ matrix.example }}-${{ github.event.inputs.baseline }}_vs_${{ github.event.inputs.branch }}
130+
path: benchmarks-sut.jar
131+
132+
benchmark:
133+
needs: build
134+
runs-on: self-hosted
135+
strategy:
136+
fail-fast: false # Jobs fail if the benchmark error is over predefined thresholds; other benchmarks continue.
137+
matrix:
138+
example: [cloud_balancing, conference_scheduling, curriculum_course, examination, machine_reassignment, meeting_scheduling, nurse_rostering, patient_admission_scheduling, task_assigning, traveling_tournament, tsp, vehicle_routing]
139+
env:
140+
MVN_USERNAME: '${{ secrets.JFROG_ENTERPRISE_READ_ONLY_ACCESS_USERNAME }}'
141+
MVN_PASSWORD: '${{ secrets.JFROG_ENTERPRISE_READ_ONLY_ACCESS_TOKEN }}'
142+
steps:
143+
- name: Phase 2 - Setup JDK and Maven
144+
uses: actions/setup-java@v4
145+
with:
146+
java-version: ${{ github.event.inputs.jdk }}
147+
distribution: 'temurin'
148+
cache: 'maven'
149+
server-id: 'timefold-solver-enterprise'
150+
server-username: 'MVN_USERNAME'
151+
server-password: 'MVN_PASSWORD'
152+
153+
- name: Phase 2 - Setup Async Profiler
154+
working-directory: ./timefold-solver-benchmarks
155+
run: |
156+
export FILENAME=async-profiler-${{ github.event.inputs.async_profiler_version }}-linux-x64.tar.gz
157+
wget https://github.com/async-profiler/async-profiler/releases/download/v${{ github.event.inputs.async_profiler_version }}/$FILENAME
158+
tar -xzf $FILENAME
159+
ls -l
160+
120161
# Fine-tuned for stability on GHA.
121-
- name: Phase 2 - Configure the benchmark
162+
- name: Phase 3 - Configure the benchmark
122163
working-directory: ./timefold-solver-benchmarks
123164
shell: bash
124165
run: |
@@ -131,7 +172,13 @@ jobs:
131172
cat scoredirector-benchmark.properties
132173
chmod +x run-scoredirector.sh
133174
134-
- name: Phase 2 - (Baseline) Run the benchmark
175+
- name: Phase 3 - (Baseline) Download the benchmark
176+
uses: actions/download-artifact@v2
177+
with:
178+
name: results-${{ matrix.example }}-${{ github.event.inputs.baseline }}_vs_${{ github.event.inputs.branch }}
179+
path: benchmarks-baseline.jar
180+
181+
- name: Phase 3 - (Baseline) Run the benchmark
135182
working-directory: ./timefold-solver-benchmarks
136183
id: benchmark_baseline
137184
env:
@@ -144,7 +191,13 @@ jobs:
144191
echo "RANGE_END=$(jq '.[0].primaryMetric.scoreConfidence[1]|round' results/scoredirector/${{ github.event.inputs.baseline }}/results.json)" >> "$GITHUB_OUTPUT"
145192
echo "RANGE_MID=$(jq '.[0].primaryMetric.score|round' results/scoredirector/${{ github.event.inputs.baseline }}/results.json)" >> "$GITHUB_OUTPUT"
146193
147-
- name: Phase 2 - (SUT) Run the benchmark
194+
- name: Phase 4 - (Baseline) Download the benchmark
195+
uses: actions/download-artifact@v2
196+
with:
197+
name: results-${{ matrix.example }}-${{ github.event.inputs.baseline }}_vs_${{ github.event.inputs.branch }}
198+
path: benchmarks-sut.jar
199+
200+
- name: Phase 4 - (SUT) Run the benchmark
148201
id: benchmark_new
149202
working-directory: ./timefold-solver-benchmarks
150203
env:
@@ -158,7 +211,7 @@ jobs:
158211
echo "RANGE_END=$(jq '.[0].primaryMetric.scoreConfidence[1]|round' results/scoredirector/${{ github.event.inputs.branch }}/results.json)" >> "$GITHUB_OUTPUT"
159212
echo "RANGE_MID=$(jq '.[0].primaryMetric.score|round' results/scoredirector/${{ github.event.inputs.branch }}/results.json)" >> "$GITHUB_OUTPUT"
160213
161-
- name: Phase 3 - Archive benchmark data
214+
- name: Phase 5 - Archive benchmark data
162215
uses: actions/upload-artifact@v4
163216
with:
164217
name: results-${{ matrix.example }}-${{ github.event.inputs.baseline }}_vs_${{ github.event.inputs.branch }}
@@ -168,7 +221,7 @@ jobs:
168221
./timefold-solver-benchmarks/scoredirector-benchmark.properties
169222
./timefold-solver-benchmarks/results/scoredirector
170223
171-
- name: Phase 3 - Report results
224+
- name: Phase 5 - Report results
172225
working-directory: ./timefold-solver-benchmarks
173226
env:
174227
OLD_RANGE_START: ${{ steps.benchmark_baseline.outputs.RANGE_START }}

0 commit comments

Comments
 (0)