@@ -64,44 +64,52 @@ jobs:
64
64
65
65
- name : Run Benchmarks
66
66
run : |
67
- echo $PATH
67
+ echo "Current PATH: $PATH"
68
68
mkdir results
69
- benchpkg --rev="${{ github.sha }},$(git rev-parse HEAD^1)" --bench-on="${{ github.sha }}" --output-dir=results/ --tune
70
-
71
- - name: Generate and Upload Benchmark Plots
72
- run: |
73
- mkdir -p plots
74
- git fetch origin main:refs/remotes/origin/main
75
- LAST_MAIN_COMMIT=$(git rev-parse origin/main)
76
- CURRENT_COMMIT=$(git rev-parse HEAD)
77
- echo "Comparing CURRENT_COMMIT ($CURRENT_COMMIT) with LAST_MAIN_COMMIT ($LAST_MAIN_COMMIT)"
78
- benchpkgplot --rev="$LAST_MAIN_COMMIT,$CURRENT_COMMIT" --npart=10 --format=png --input-dir=results/ --output-dir=plots/
79
- if: always()
80
-
69
+ git fetch origin main:refs/remotes/origin/main
70
+ if [ $(git rev-list --count HEAD) -gt 1 ]; then
71
+ PREV_COMMIT=$(git rev-parse HEAD^1)
72
+ else
73
+ PREV_COMMIT=$(git rev-parse HEAD) # Fallback to the current commit if there's no previous commit
74
+ fi
75
+ CURRENT_COMMIT=$(git rev-parse HEAD)
76
+ LAST_MAIN_COMMIT=$(git rev-parse origin/main)
77
+ echo "Benchmarking current commit ($CURRENT_COMMIT) against $PREV_COMMIT"
78
+ benchpkg --rev="$LAST_MAIN_COMMIT,$CURRENT_COMMIT" --bench-on="$CURRENT_COMMIT" --output-dir=results/ --tune
79
+
80
+ - name : Generate and Upload Benchmark Plots
81
+ run : |
82
+ mkdir -p plots
83
+ LAST_MAIN_COMMIT=$(git rev-parse origin/main)
84
+ CURRENT_COMMIT=$(git rev-parse HEAD)
85
+ echo "Generating plots comparing CURRENT_COMMIT ($CURRENT_COMMIT) with LAST_MAIN_COMMIT ($LAST_MAIN_COMMIT)"
86
+ benchpkgplot --rev="$LAST_MAIN_COMMIT,$CURRENT_COMMIT" --npart=10 --format=png --input-dir=results/ --output-dir=plots/
87
+ if : always()
88
+
81
89
- name : Upload Plots as Artifacts
82
90
uses : actions/upload-artifact@v4
83
91
with :
84
92
name : benchmark-plots
85
93
path : plots
86
-
94
+
87
95
- name : Create and Display Benchmark Table
88
96
run : |
89
- git fetch origin main:refs/remotes/origin/main # Ensures you have the latest main branch
97
+ mkdir -p results
90
98
if [ $(git rev-list --count HEAD) -gt 1 ]; then
91
99
PREV_COMMIT=$(git rev-parse HEAD^1)
92
100
else
93
- PREV_COMMIT=$(git rev-parse HEAD) # Fallback to the current commit if there's no previous commit
101
+ PREV_COMMIT=$(git rev-parse HEAD) # Use the current commit as a fallback
94
102
fi
95
- LAST_MAIN_COMMIT=$(git rev-parse origin/main) # Ensures comparison against the latest commit in main
96
- echo "Using revisions: $LAST_MAIN_COMMIT and $PREV_COMMIT for benchmark comparison. "
103
+ LAST_MAIN_COMMIT=$(git rev-parse origin/main) # Fetch the latest commit from main for comparison
104
+ echo "Creating benchmark table comparing CURRENT_COMMIT with LAST_MAIN_COMMIT "
97
105
benchpkgtable --rev="$LAST_MAIN_COMMIT,$PREV_COMMIT" --input-dir=results/ > table.md
98
106
echo '### Benchmark Results' > body.md
99
107
cat table.md >> body.md
100
108
echo '### Benchmark Plots' >> body.md
101
109
echo 'A plot of the benchmark results has been uploaded as an artifact to this workflow run.' >> body.md
102
110
cat body.md # Print the markdown table to the log for review.
103
111
if : always()
104
-
112
+
105
113
- name : Upload Benchmark Results Table
106
114
uses : actions/upload-artifact@v4
107
115
with :
0 commit comments