Skip to content

Add reusable workflow for build and tests on PR labels#65

Merged
farshidtz merged 14 commits into
v2from
reuse-pr-workflow
Jul 8, 2026
Merged

Add reusable workflow for build and tests on PR labels#65
farshidtz merged 14 commits into
v2from
reuse-pr-workflow

Conversation

@farshidtz

@farshidtz farshidtz commented Jul 2, 2026

Copy link
Copy Markdown
Member

Changes between the newly added reusable workflow and workflows used on existing inference snaps:

  • init-build-script is deprecated. It is hardcoded to download-models.sh and the caller repo can expect that it will be run if provided. Future version of this reusable workflow will instead run a specific make recipe to download models.
  • The build pre-checks applies to both build and test triggers. If a build is detected as present, subsequent requests to build and test get skipped. This change was done primarily to simplify the job conditions. To force a rebuild, one can still delete the workflow log or push an empty commit.
  • Support for custom labels has been dropped. Caller must now use trigger-build and trigger-tests labels.

Example caller workflow:

name: PR Label

on:
  pull_request:
    types: [ labeled ]

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
  cancel-in-progress: true

permissions:
  contents: read
  pull-requests: write
  actions: read

jobs:

  build-test:
    # The applied label is used to select build/test tasks and as job's display name.
    name: ${{ github.event.label.name }}
    uses: canonical/inference-snaps-dev/.github/workflows/reuse-pr-build-test.yaml@v2
    with:
      trigger-label: ${{ github.event.label.name }}
      pr-number: "${{ github.event.pull_request.number }}"
      build-runners: |
        [
          ["amd64", "resolute", "self-hosted"],
          ["arm64", "resolute", "self-hosted"]
        ]
      test-jobs-matrix: |
        [
          {
            "job-queue": "maas-systemtests-amd64",
            "provision-data": "distro: noble",
            "select-engine": "cpu",
            "test-chat-tps": true
          },
          {
            "job-queue": "anbox-nvidia-amd64",
            "provision-data": "distro: noble",
            "install-nvidia-driver-version": 595,
            "select-engine": "nvidia-gpu",
            "test-chat-tps": true,
            "expected-tps": 9.4
          }
        ]
      snap-name: smollm2
    secrets:
      store-credentials: ${{ secrets.STORE_LOGIN_PR }}
      github-token: ${{ secrets.GITHUB_TOKEN }}

Example runs:

image image

@farshidtz farshidtz force-pushed the reuse-pr-workflow branch from 42d39de to fdb81e7 Compare July 2, 2026 16:16
@farshidtz farshidtz force-pushed the reuse-pr-workflow branch from d8ae744 to e235586 Compare July 3, 2026 20:39
@farshidtz farshidtz force-pushed the reuse-pr-workflow branch from 42b2c1a to c4e7642 Compare July 6, 2026 08:26
@farshidtz farshidtz force-pushed the reuse-pr-workflow branch from c4e7642 to 600bb94 Compare July 6, 2026 09:43
@farshidtz farshidtz force-pushed the reuse-pr-workflow branch from bfb32a1 to 2664176 Compare July 6, 2026 16:27
@farshidtz farshidtz marked this pull request as ready for review July 6, 2026 20:45
@farshidtz farshidtz requested a review from mrmara July 7, 2026 05:41
@farshidtz farshidtz merged commit ceaebe1 into v2 Jul 8, 2026
1 check passed
@farshidtz farshidtz deleted the reuse-pr-workflow branch July 8, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants