Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,20 @@ on:
runs-on:
required: true
type: string
# JSON runs-on chosen by a caller's forge-pool selector (pool-select).
# Empty keeps `runs-on`, which still names caches and artifacts.
pool-runs-on:
required: false
type: string
default: ""
run-dylint:
required: false
type: boolean
default: false

jobs:
lint:
runs-on: ${{ inputs.runs-on }}
runs-on: ${{ inputs.pool-runs-on != '' && fromJSON(inputs.pool-runs-on) || inputs.runs-on }}
timeout-minutes: 30
env:
SOLDR_FORCE_MANAGED_CARGO_SUBCOMMANDS: "1"
Expand Down
36 changes: 35 additions & 1 deletion .github/workflows/linux-x86-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,37 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}

jobs:
# Runner selection for the Lint call. pool-select (forge-ci/ci.yml
# actions/pool-select) reads the forge pool's tokenless status endpoint and
# answers with the repository variable FORGE_POOL_LABELS (the self-hosted
# Dell pool, Ubuntu 24.04 image) when the pool has an idle matching runner
# and the event is trusted: push, workflow_dispatch, or a pull request from
# this repository. Fork pull requests, an unset variable, or any error give
# ubuntu-24.04. The selector itself runs on forge-quick
# (vars.FORGE_QUICK_LABELS), never for a fork pull request. Unset either
# variable to fall back to hosted.
pool:
name: Select runner
if: >-
vars.FORGE_POOL_LABELS != ''
&& (github.event_name == 'push'
|| github.event_name == 'workflow_dispatch'
|| (github.event_name == 'pull_request'
&& github.event.pull_request.head.repo.full_name == github.repository))
runs-on: ${{ vars.FORGE_QUICK_LABELS != '' && fromJSON(vars.FORGE_QUICK_LABELS) || 'ubuntu-latest' }}
timeout-minutes: 2
permissions: {}
outputs:
runs-on: ${{ steps.select.outputs.runs-on || '"ubuntu-24.04"' }}
steps:
- name: Select pool or hosted
id: select
continue-on-error: true
uses: forge-ci/ci.yml/actions/pool-select@a36bc81ad6ada5fb17398e3e7ba38435cc67a951
with:
labels: ${{ vars.FORGE_POOL_LABELS }}
fallback: ubuntu-24.04

verify:
name: Verify local attestations
if: >-
Expand Down Expand Up @@ -49,12 +80,15 @@ jobs:

call:
name: Lint (format, Clippy, Dylint)
needs: verify
needs: [verify, pool]
if: ${{ !cancelled() && needs.verify.outputs.skip_call != 'true' }}
uses: ./.github/workflows/_lint.yml
with:
source-sha: ${{ github.event_name == 'workflow_dispatch' && inputs.candidate_sha || github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
runs-on: ubuntu-24.04
# Only a selector that ran has an answer (act passes a skipped job's
# outputs on unevaluated); otherwise runs-on above applies.
pool-runs-on: ${{ needs.pool.result == 'success' && needs.pool.outputs.runs-on || '' }}
run-dylint: true

unit:
Expand Down
Loading