Skip to content

Commit 3105cfd

Browse files
committed
Update workflow to run two benchmarks
This commit is a test to check if running both the benchmarks in the same workflow would make any difference to the results Signed-off-by: Arjun Raja Yogidas <[email protected]>
1 parent 45a1d0e commit 3105cfd

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed

.github/workflows/benchmark_regression_test.yml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,40 +12,47 @@ on:
1212
- 'integration/**'
1313
- 'scripts/**'
1414
- '.github/workflows/**'
15-
15+
1616
jobs:
17-
benchmark-and-fetch-previous-results_and_compare:
18-
name: Run Benchmark on current Branch
17+
test-twice:
1918
runs-on: ubuntu-20.04
19+
2020
steps:
21-
- uses: actions/checkout@v3
2221
- uses: actions/setup-go@v4
2322
with:
2423
go-version: '1.18.10'
24+
- name: Checkout main
25+
uses: actions/checkout@v3
26+
with:
27+
ref: main
2528
- run: make
2629
- name: Run benchmark
27-
run: make benchmarks-perf-test
30+
run: make benchmarks-perf-test
2831
- name: Make previous directory
2932
run: mkdir -v ${{ github.workspace }}/previous
30-
- name: Download previous run artifact
31-
id: download-artifact
32-
uses: dawidd6/action-download-artifact@v2
33+
- name: Copy results to previous directory
34+
run: cp -r ${{ github.workspace }}/benchmark/performanceTest/output ${{ github.workspace }}/previous
35+
- name: Check out PR
36+
uses: actions/checkout@v3
3337
with:
34-
github_token: ${{secrets.GITHUB_TOKEN}}
35-
name: benchmark-result-artifact
36-
name_is_regexp: true
37-
path: ${{ github.workspace }}/previous
38-
repo: ${{ github.repository }}
39-
check_artifacts: false
40-
search_artifacts: true
41-
skip_unpack: false
42-
if_no_artifact_found: fail
43-
workflow: benchmark_visualization.yml
38+
ref: ${{ github.event.pull_request.head.sha }}
39+
- run: make
40+
- name: Run benchmark
41+
run: make benchmarks-perf-test
42+
- name: Make current directory
43+
run: mkdir -v ${{ github.workspace }}/current
44+
- name: Stash uncommitted changes
45+
run: git stash push --keep-index --include-untracked -m "Stashing changes for tests"
46+
# If you're using Git version 2.28 or later, use this line instead:
47+
# run: git stash push --keep-index --include-untracked -m "Stashing changes for tests"
48+
# This will ensure that uncommitted changes do not interfere with the tests.
49+
- name: Copy results to current directory
50+
run: cp -r ${{ github.workspace }}/benchmark/performanceTest/output ${{ github.workspace }}/current
4451
- name: Perform Comparison and log results
4552
id: run-compare
4653
run: |
4754
sudo chmod +x ${{ github.workspace }}/scripts/check_regression.sh
48-
if sudo ${{ github.workspace }}/scripts/check_regression.sh ${{ github.workspace }}/previous/benchmark-result-artifact/results.json ${{github.workspace}}/benchmark/performanceTest/output/results.json; then
55+
if sudo ${{ github.workspace }}/scripts/check_regression.sh ${{ github.workspace }}/previous/results.json ${{github.workspace}}/current/results.json; then
4956
echo "Comparison successful. All P90 values are within the acceptable range."
5057
else
5158
echo "Comparison failed. Current P90 values exceed 110% of the corresponding past values."

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ build-benchmarks:
104104

105105
benchmarks-perf-test:
106106
@echo "$@"
107-
@cd benchmark/performanceTest ; sudo rm -rf output ; GO111MODULE=$(GO111MODULE_VALUE) go build -o ../bin/PerfTests . && sudo ../bin/PerfTests -show-commit
107+
@cd benchmark/performanceTest ; sudo rm -rf output ; GO111MODULE=$(GO111MODULE_VALUE) go build -o ../bin/PerfTests . && sudo ../bin/PerfTests -show-commit -count 2
108108

109109
benchmarks-stargz:
110110
@echo "$@"

0 commit comments

Comments
 (0)