|
| 1 | +name: Bench Check Node Compat |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + ref: |
| 7 | + description: Branch or tag to benchmark |
| 8 | + required: true |
| 9 | + default: fireactions-runners |
| 10 | + runner_label: |
| 11 | + description: Fireactions benchmark label |
| 12 | + required: true |
| 13 | + sweep_id: |
| 14 | + description: Sweep identifier |
| 15 | + required: true |
| 16 | + rep: |
| 17 | + description: Repetition number |
| 18 | + required: true |
| 19 | + bench_job_key: |
| 20 | + description: Job selector (build or test) |
| 21 | + required: true |
| 22 | + default: build |
| 23 | + |
| 24 | +run-name: bench-check-node-compat | ${{ inputs.sweep_id }} | ${{ inputs.bench_job_key }} | ${{ inputs.runner_label }} | rep-${{ inputs.rep }} |
| 25 | + |
| 26 | +concurrency: |
| 27 | + group: bench-check-node-compat-${{ inputs.sweep_id }}-${{ inputs.bench_job_key }}-${{ inputs.runner_label }}-rep-${{ inputs.rep }} |
| 28 | + cancel-in-progress: false |
| 29 | + |
| 30 | +env: |
| 31 | + CARGO_TERM_COLOR: always |
| 32 | + CARGO_BUILD_JOBS: 4 |
| 33 | + |
| 34 | +jobs: |
| 35 | + build: |
| 36 | + if: ${{ inputs.bench_job_key == 'build' || inputs.bench_job_key == 'test' }} |
| 37 | + name: build ${{ matrix.version.name }} |
| 38 | + runs-on: [self-hosted, ${{ inputs.runner_label }}] |
| 39 | + env: |
| 40 | + RUST_BACKTRACE: full |
| 41 | + strategy: |
| 42 | + matrix: |
| 43 | + version: |
| 44 | + - name: old |
| 45 | + ref: devnet-ready |
| 46 | + - name: new |
| 47 | + ref: ${{ inputs.ref }} |
| 48 | + steps: |
| 49 | + - name: Install dependencies |
| 50 | + run: | |
| 51 | + sudo DEBIAN_FRONTEND=noninteractive NEEDRESTART_MODE=a apt-get update |
| 52 | + 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 |
| 53 | + - uses: actions-rs/toolchain@v1 |
| 54 | + with: |
| 55 | + toolchain: stable |
| 56 | + - uses: Swatinem/rust-cache@v2 |
| 57 | + with: |
| 58 | + key: bench-check-node-compat-${{ matrix.version.name }} |
| 59 | + - name: Checkout ${{ matrix.version.name }} |
| 60 | + uses: actions/checkout@v4 |
| 61 | + with: |
| 62 | + ref: ${{ matrix.version.ref }} |
| 63 | + path: ${{ matrix.version.name }} |
| 64 | + - name: Build ${{ matrix.version.name }} |
| 65 | + working-directory: ${{ matrix.version.name }} |
| 66 | + run: cargo build --release --locked |
| 67 | + - name: Upload ${{ matrix.version.name }} node binary |
| 68 | + uses: actions/upload-artifact@v4 |
| 69 | + with: |
| 70 | + name: node-subtensor-${{ matrix.version.name }} |
| 71 | + path: ${{ matrix.version.name }}/target/release/node-subtensor |
| 72 | + retention-days: 1 |
| 73 | + |
| 74 | + test: |
| 75 | + if: ${{ inputs.bench_job_key == 'test' }} |
| 76 | + needs: [build] |
| 77 | + runs-on: [self-hosted, ${{ inputs.runner_label }}] |
| 78 | + steps: |
| 79 | + - uses: actions/download-artifact@v4 |
| 80 | + with: |
| 81 | + name: node-subtensor-old |
| 82 | + path: /tmp/node-subtensor-old |
| 83 | + - uses: actions/download-artifact@v4 |
| 84 | + with: |
| 85 | + name: node-subtensor-new |
| 86 | + path: /tmp/node-subtensor-new |
| 87 | + - uses: actions/setup-node@v4 |
| 88 | + with: |
| 89 | + node-version: "24" |
| 90 | + - uses: actions/checkout@v4 |
| 91 | + with: |
| 92 | + ref: ${{ inputs.ref }} |
| 93 | + - name: Install npm dependencies |
| 94 | + working-directory: ${{ github.workspace }}/.github/workflows/check-node-compat |
| 95 | + run: npm install |
| 96 | + - name: Run test |
| 97 | + working-directory: ${{ github.workspace }}/.github/workflows/check-node-compat |
| 98 | + run: npm run test |
0 commit comments