1818 - created
1919 - edited
2020
21- env :
22- CC : clang-22
23- CXX : clang++-22
24-
2521jobs :
2622 permission-check :
2723 if : >-
@@ -45,12 +41,12 @@ jobs:
4541 LLVM_TOKEN_GENERATOR_CLIENT_ID : ${{ secrets.LLVM_TOKEN_GENERATOR_CLIENT_ID }}
4642 LLVM_TOKEN_GENERATOR_PRIVATE_KEY : ${{ secrets.LLVM_TOKEN_GENERATOR_PRIVATE_KEY }}
4743
48- run-benchmarks :
49- permissions :
50- pull-requests : write
51- runs-on : llvm-premerge-libcxx-next-runners # TODO: This should run on a dedicated set of machines
44+ extract-info :
45+ runs-on : ubuntu-24.04
5246 needs :
5347 - permission-check
48+ permissions :
49+ pull-requests : write
5450 steps :
5551 - uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
5652 with :
@@ -78,59 +74,103 @@ jobs:
7874 BENCHMARKS=$(echo "$COMMENT_BODY" | sed -nE 's/\/libcxx-bot benchmark (.+)/\1/p')
7975 echo "benchmarks=${BENCHMARKS}" >> ${GITHUB_OUTPUT}
8076
81- - name : Update comment with link to the job
82- env :
83- JOB_CHECK_RUN_ID : ${{ job.check_run_id }}
77+ - name : Update comment with link to the run
8478 run : |
8579 source .venv/bin/activate
8680 cat <<EOF | python
8781 import github
8882 repo = github.Github(auth=github.Auth.Token("${{ github.token }}")).get_repo("${{ github.repository }}")
8983 pr = repo.get_pull(${{ github.event.issue.number }})
9084 comment = pr.get_issue_comment(${{ github.event.comment.id }})
91- add_text = "> _Running benchmarks in ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/job/${JOB_CHECK_RUN_ID} _"
85+ add_text = "> _Running benchmarks in ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}_"
9286 comment.edit('\n\n'.join([comment.body, add_text]))
9387 EOF
88+ outputs :
89+ pr_base : ${{ steps.vars.outputs.pr_base }}
90+ pr_head : ${{ steps.vars.outputs.pr_head }}
91+ benchmarks : ${{ steps.vars.outputs.benchmarks }}
9492
93+ run-benchmarks :
94+ strategy :
95+ matrix :
96+ include :
97+ - platform : macOS 26.5 arm64
98+ runner : ["self-hosted", "macOS", "ARM64", "26", "26.5"]
99+ cc : clang
100+ cxx : clang++
101+ install-python : false
102+ install-macos-dependencies : true
103+ - platform : Linux x86_64
104+ runner : llvm-premerge-libcxx-next-runners
105+ cc : clang-22
106+ cxx : clang++-22
107+ install-python : true
108+ install-macos-dependencies : false
109+ fail-fast : false
110+ permissions :
111+ pull-requests : write
112+ runs-on : ${{ matrix.runner }}
113+ needs :
114+ - extract-info
115+ env :
116+ CC : ${{ matrix.cc }}
117+ CXX : ${{ matrix.cxx }}
118+ steps :
95119 - uses : actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
96120 with :
97121 persist-credentials : false
98- ref : ${{ steps.vars .outputs.pr_head }}
122+ ref : ${{ needs.extract-info .outputs.pr_head }}
99123 fetch-depth : 0
100124 fetch-tags : true # This job requires access to all the Git branches so it can diff against (usually) main
101- path : repo # Avoid nuking the workspace, where we have the Python virtualenv
125+
126+ - name : Install Python
127+ if : ${{ matrix.install-python }}
128+ uses : actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
129+ with :
130+ python-version : ' 3.14'
131+
132+ - name : Install Ninja and CMake
133+ if : ${{ matrix.install-macos-dependencies }}
134+ run : |
135+ brew install ninja cmake
136+
137+ - name : Setup virtual environment
138+ run : |
139+ python3 -m venv .venv
140+ source .venv/bin/activate
141+ python -m pip install -r libcxx/utils/requirements.txt
142+ python -m pip install pygithub==2.8.1
102143
103144 - name : Build and run baseline
104145 env :
105- BENCHMARKS : ${{ steps.vars .outputs.benchmarks }}
106- PR_HEAD : ${{ steps.vars .outputs.pr_head }}
107- PR_BASE : ${{ steps.vars .outputs.pr_base }}
146+ BENCHMARKS : ${{ needs.extract-info .outputs.benchmarks }}
147+ PR_HEAD : ${{ needs.extract-info .outputs.pr_head }}
148+ PR_BASE : ${{ needs.extract-info .outputs.pr_base }}
108149 run : |
109- source .venv/bin/activate && cd repo
110- python -m pip install -r libcxx/utils/requirements.txt
150+ source .venv/bin/activate
111151 baseline_commit=$(git merge-base $PR_BASE $PR_HEAD)
112152 ./libcxx/utils/build-at-commit --commit ${baseline_commit} --install-dir install/baseline -- -DCMAKE_BUILD_TYPE=RelWithDebInfo
113153 ./libcxx/utils/test-at-commit --libcxx-installation install/baseline -B benchmarks/baseline -- -sv -j1 --param optimization=speed "$BENCHMARKS"
114154 ./libcxx/utils/consolidate-benchmarks benchmarks/baseline | tee baseline.lnt
115155
116156 - name : Build and run candidate
117157 env :
118- BENCHMARKS : ${{ steps.vars .outputs.benchmarks }}
119- PR_HEAD : ${{ steps.vars .outputs.pr_head }}
158+ BENCHMARKS : ${{ needs.extract-info .outputs.benchmarks }}
159+ PR_HEAD : ${{ needs.extract-info .outputs.pr_head }}
120160 run : |
121- source .venv/bin/activate && cd repo
161+ source .venv/bin/activate
122162 ./libcxx/utils/build-at-commit --commit $PR_HEAD --install-dir install/candidate -- -DCMAKE_BUILD_TYPE=RelWithDebInfo
123163 ./libcxx/utils/test-at-commit --libcxx-installation install/candidate -B benchmarks/candidate -- -sv -j1 --param optimization=speed "$BENCHMARKS"
124164 ./libcxx/utils/consolidate-benchmarks benchmarks/candidate | tee candidate.lnt
125165
126166 - name : Compare baseline and candidate runs
127167 run : |
128- source .venv/bin/activate && cd repo
168+ source .venv/bin/activate
129169 ./libcxx/utils/compare-benchmarks baseline.lnt candidate.lnt | tee results.txt
130170
131171 - name : Update comment with results
132172 run : |
133- source .venv/bin/activate && cd repo
173+ source .venv/bin/activate
134174 cat <<EOF | python
135175 import github
136176 repo = github.Github(auth=github.Auth.Token("${{ github.token }}")).get_repo("${{ github.repository }}")
@@ -144,7 +184,7 @@ jobs:
144184
145185 <details>
146186 <summary>
147- Benchmark results:
187+ Benchmark results for ${{ matrix.platform }} :
148188 </summary>
149189
150190 \`\`\`
0 commit comments