[libcxx-commits] [libcxx] [llvm] [libc++] Extract LNT benchmark validation into a reusable workflow (PR #232155)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Oct 14 18:54:40 PDT 2026
================
@@ -45,72 +45,31 @@
default: https://lnt.llvm.org
jobs:
- # Determine which configuration to run based on the `lnt-machine` input.
- select-machine:
- runs-on: ubuntu-26.04
- outputs:
- matrix: ${{ steps.select.outputs.matrix }}
- steps:
- - name: Checkout the machine definitions
- uses: actions/checkout at 3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- with:
- persist-credentials: false
- # Disabling cone mode allows checking out exactly the single file we need.
- sparse-checkout: libcxx/utils/ci/lnt/machines.json
- sparse-checkout-cone-mode: false
-
- - name: Select the configuration to benchmark on
- id: select
- uses: actions/github-script at 3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
- env:
- LNT_MACHINE: ${{ inputs.lnt-machine }}
- BENCHMARK_SUITE_OVERRIDE: ${{ inputs.benchmark-suite-override }}
- SUBMIT_LNT: ${{ inputs.submit-lnt }}
- with:
- script: |
- const config = JSON.parse(require('fs').readFileSync('libcxx/utils/ci/lnt/machines.json', 'utf8'));
-
- const requested = process.env.LNT_MACHINE;
- const selected = config.filter(cfg => cfg['lnt-machine'] === requested);
- if (selected.length === 0) {
- const known = config.map(cfg => cfg['lnt-machine']).join(', ');
- core.setFailed(`Unknown LNT machine '${requested}' (known machines: ${known})`);
- return;
- }
-
- // Honor benchmark suite version override and make sure we don't submit if an incorrect
- // override is provided.
- const version_override = (process.env.BENCHMARK_SUITE_OVERRIDE || '').trim().toLowerCase();
- for (const cfg of selected) {
- const pinned = cfg['benchmark-suite-version'];
- if (process.env.SUBMIT_LNT === 'true' && version_override && version_override !== pinned) {
- core.setFailed(`Refusing to submit results for ${cfg['lnt-machine']}, since the benchmark suite was `
- + `overridden to version ${version_override}, which is different from the version `
- + `pinned in machines.json (${pinned}).`);
- return;
- }
-
- if (version_override) {
- cfg['benchmark-suite-version'] = version_override;
- }
- }
-
- core.setOutput('matrix', JSON.stringify(selected));
+ # Validate the inputs and select the configuration of the machine to benchmark on.
+ validate:
+ uses: $/.github/workflows/libcxx-lnt-validate.yml
+ with:
+ lnt-machine: ${{ inputs.lnt-machine }}
+ benchmark-suite-override: ${{ inputs.benchmark-suite-override }}
+ submit-lnt: ${{ inputs.submit-lnt }}
run-benchmarks:
+ name: Run benchmarks on ${{ inputs.lnt-machine }}
needs:
- - select-machine
- strategy:
- matrix:
- include: ${{ fromJSON(needs.select-machine.outputs.matrix) }}
- fail-fast: false
- runs-on: ${{ matrix.runner }}
- container: ${{ matrix.container || null }}
+ - validate
+ runs-on: ${{ fromJSON(needs.validate.outputs.setup).runner }}
+ container: ${{ fromJSON(needs.validate.outputs.setup).container || null }}
----------------
github-advanced-security[bot] wrote:
## zizmor /
unpinned image references: container image may be unpinned
[Show more details](https://github.com/llvm/llvm-project/security/code-scanning/2422)
https://github.com/llvm/llvm-project/pull/232155
More information about the libcxx-commits
mailing list