ci: harden bench workflow input references #3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Bench Check Node Compat | ||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: | ||
| description: Branch or tag to benchmark | ||
| required: true | ||
| default: fireactions-runners | ||
| runner_label: | ||
| description: Fireactions benchmark label | ||
| required: true | ||
| sweep_id: | ||
| description: Sweep identifier | ||
| required: true | ||
| rep: | ||
| description: Repetition number | ||
| required: true | ||
| bench_job_key: | ||
| description: Job selector (build or test) | ||
| required: true | ||
| default: build | ||
| run-name: bench-check-node-compat | ${{ github.event.inputs.sweep_id }} | ${{ github.event.inputs.bench_job_key }} | ${{ github.event.inputs.runner_label }} | rep-${{ github.event.inputs.rep }} | ||
| concurrency: | ||
| group: bench-check-node-compat-${{ github.event.inputs.sweep_id }}-${{ github.event.inputs.bench_job_key }}-${{ github.event.inputs.runner_label }}-rep-${{ github.event.inputs.rep }} | ||
| cancel-in-progress: false | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| CARGO_BUILD_JOBS: 4 | ||
| jobs: | ||
| build: | ||
| if: ${{ github.event.inputs.bench_job_key == 'build' || github.event.inputs.bench_job_key == 'test' }} | ||
| name: build ${{ matrix.version.name }} | ||
| runs-on: [self-hosted, ${{ github.event.inputs.runner_label }}] | ||
| env: | ||
| RUST_BACKTRACE: full | ||
| strategy: | ||
| matrix: | ||
| version: | ||
| - name: old | ||
| ref: devnet-ready | ||
| - name: new | ||
| ref: ${{ github.event.inputs.ref }} | ||
| steps: | ||
| - name: Install dependencies | ||
| run: | | ||
| sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update | ||
| sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get install -y --no-install-recommends -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" build-essential clang curl git make libssl-dev llvm libudev-dev protobuf-compiler pkg-config unzip | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| toolchain: stable | ||
| - uses: Swatinem/rust-cache@v2 | ||
| with: | ||
| key: bench-check-node-compat-${{ matrix.version.name }} | ||
| - name: Checkout ${{ matrix.version.name }} | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ matrix.version.ref }} | ||
| path: ${{ matrix.version.name }} | ||
| - name: Build ${{ matrix.version.name }} | ||
| working-directory: ${{ matrix.version.name }} | ||
| run: cargo build --release --locked | ||
| - name: Upload ${{ matrix.version.name }} node binary | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: node-subtensor-${{ matrix.version.name }} | ||
| path: ${{ matrix.version.name }}/target/release/node-subtensor | ||
| retention-days: 1 | ||
| test: | ||
| if: ${{ github.event.inputs.bench_job_key == 'test' }} | ||
| needs: [build] | ||
| runs-on: [self-hosted, ${{ github.event.inputs.runner_label }}] | ||
| steps: | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: node-subtensor-old | ||
| path: /tmp/node-subtensor-old | ||
| - uses: actions/download-artifact@v4 | ||
| with: | ||
| name: node-subtensor-new | ||
| path: /tmp/node-subtensor-new | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "24" | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ github.event.inputs.ref }} | ||
| - name: Install npm dependencies | ||
| working-directory: ${{ github.workspace }}/.github/workflows/check-node-compat | ||
| run: npm install | ||
| - name: Run test | ||
| working-directory: ${{ github.workspace }}/.github/workflows/check-node-compat | ||
| run: npm run test | ||