feat(dut-network): add VLAN sub-interface and policy-based routing support #3804
Workflow file for this run
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: Linters | |
| on: | |
| workflow_dispatch: | |
| pull_request: | |
| merge_group: | |
| permissions: | |
| contents: read | |
| pull-requests: read | |
| jobs: | |
| # Detect which paths changed to conditionally run linters | |
| changes: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| controller: ${{ steps.filter.outputs.controller }} | |
| protocol: ${{ steps.filter.outputs.protocol }} | |
| python: ${{ steps.filter.outputs.python }} | |
| rust: ${{ steps.filter.outputs.rust }} | |
| renovate: ${{ steps.filter.outputs.renovate }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - uses: dorny/paths-filter@ceb8a2b8f2d89434be7ff52d3de7ec3738c5cc9d # v4 | |
| id: filter | |
| with: | |
| filters: | | |
| controller: | |
| - 'controller/**' | |
| - '.github/workflows/lint.yaml' | |
| protocol: | |
| - 'protocol/**' | |
| - '.github/workflows/lint.yaml' | |
| python: | |
| - 'python/**' | |
| - '.github/workflows/lint.yaml' | |
| rust: | |
| - 'rust/**' | |
| - '.github/workflows/lint.yaml' | |
| renovate: | |
| - 'renovate.jsonc' | |
| - '.github/workflows/lint.yaml' | |
| lint-go: | |
| needs: changes | |
| if: needs.changes.outputs.controller == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Go | |
| uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7 | |
| with: | |
| go-version-file: .go-version | |
| cache-dependency-path: "**/go.sum" | |
| - name: Run go linter | |
| working-directory: controller | |
| run: make lint | |
| lint-protobuf: | |
| needs: changes | |
| if: needs.changes.outputs.protocol == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| ref: ${{ github.event.pull_request.head.sha }} | |
| - name: Run protobuf linter | |
| working-directory: protocol | |
| run: make lint | |
| lint-python: | |
| needs: changes | |
| if: needs.changes.outputs.python == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Run ruff | |
| uses: astral-sh/ruff-action@278981a28ce3188b1e39527901f38254bf3aac89 # v4.1.0 | |
| with: | |
| src: './python' | |
| version-file: python/pyproject.toml | |
| type-check-python: | |
| needs: changes | |
| if: needs.changes.outputs.python == 'true' | |
| runs-on: ubuntu-latest | |
| continue-on-error: true | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - id: uv | |
| run: echo "version=$(cat .uv-version)" >> "$GITHUB_OUTPUT" | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0 | |
| with: | |
| version: ${{ steps.uv.outputs.version }} | |
| python-version-file: .py-version | |
| - name: Run ty | |
| working-directory: python | |
| run: make ty | |
| lint-rust: | |
| needs: changes | |
| if: needs.changes.outputs.rust == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| with: | |
| persist-credentials: false | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@4360b52568e2003a75bf9bc1d59f33a8e3fc893c # stable | |
| with: | |
| toolchain: stable | |
| components: clippy, rustfmt | |
| - name: Check formatting | |
| working-directory: rust | |
| run: make fmt | |
| - name: Run clippy | |
| working-directory: rust | |
| run: make lint | |
| validate-renovate: | |
| needs: changes | |
| if: needs.changes.outputs.renovate == 'true' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Validate Renovate config | |
| run: npx --yes --package renovate -- renovate-config-validator | |
| typos: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | |
| - name: Run typos | |
| uses: crate-ci/typos@8a48f81b6c64dcfea44b3633223084c4be58ac5f # v1.49.0 | |
| with: | |
| config: ./typos.toml |