chore(deps): Bump golangci/golangci-lint-action from 6 to 7 #2731
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: CI | |
concurrency: | |
group: ci-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
on: | |
push: | |
branches: | |
- master | |
- release/* | |
tags: | |
- "v*" | |
paths-ignore: | |
- 'docs/**' | |
- 'README.md' | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
- labeled | |
- unlabeled | |
schedule: | |
- cron: "0 10 * * *" # ~2am PST | |
workflow_dispatch: | |
inputs: | |
run_release_test: | |
type: boolean | |
description: "Run release tests in vlab/hlab" | |
required: false | |
default: false | |
debug_enabled: | |
type: boolean | |
description: "Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)" | |
required: false | |
default: false | |
jobs: | |
test: | |
runs-on: lab-h | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
- name: Setup Just | |
uses: extractions/setup-just@v3 | |
- name: Lint and generate code | |
run: | | |
just --timestamp lint-gha gen _lint | |
- name: More Go lint | |
uses: golangci/golangci-lint-action@v7 | |
with: | |
# keep in sync with hack/tools.just | |
version: v1.64.2 | |
- name: Run tests | |
run: | | |
just --timestamp test | |
- name: Go mod tidy | |
run: | | |
go mod tidy | |
go mod vendor | |
# Don't remove it! We shouldn't allow CI to pass if there are any changes not committed after running gen/lint/test | |
- name: Fail on dirty | |
run: | | |
if ! git status --short || ! git diff --quiet; then | |
git --no-pager diff -- . :^vendor | |
echo "::error::Working directory is dirty. Please run 'just gen lint && go mod tidy && go mod vendor' and commit the changes." | |
exit 1 | |
fi | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true | |
# faster build installer without airgap using hosted runners and ghcr.io | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 15 | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest-x86-4-cores | |
- ubuntu-24.04-arm64-4-core | |
- macos-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
- name: Setup Just | |
uses: extractions/setup-just@v3 | |
- name: Setup docker on MacOS | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew install --formula docker | |
- name: Setup oras | |
uses: oras-project/setup-oras@v1 | |
- name: Setup local registry | |
env: | |
LOCALREG_SYNC_REGISTRY: ghcr.io | |
LOCALREG_SYNC_USERNAME: ${{ github.actor }} | |
LOCALREG_SYNC_PASSWORD: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
just --timestamp _localreg & | |
- name: Build hhfab for local OS/ARCH | |
run: | | |
just --timestamp oci_repo=127.0.0.1:30000 oci=http hhfab-build-local _hhfabctl-push-main | |
- name: hhfab init | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
run: | | |
bin/hhfab init -v --dev --import-host-upstream | |
- name: hhfab build --mode=manual | |
run: | | |
bin/hhfab build -v --mode=manual | |
ls -lah result | |
- name: hhfab build --mode=usb | |
run: | | |
bin/hhfab build -v --mode=usb | |
ls -lah result | |
- name: hhfab build --mode=iso | |
run: | | |
bin/hhfab build -v --mode=iso | |
ls -lah result | |
- name: Dump local registry logs | |
if: ${{ always() }} | |
run: | | |
cat .zot/log | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true | |
build-multi: | |
runs-on: lab-h | |
timeout-minutes: 15 | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
- name: Setup Just | |
uses: extractions/setup-just@v3 | |
- name: Build bins for all OS/ARCH | |
run: | | |
just --timestamp build-multi | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true | |
builds: | |
runs-on: ubuntu-latest | |
needs: | |
- build | |
- build-multi | |
if: ${{ always() }} | |
steps: | |
- run: | | |
result="${{ needs.build.result }}" | |
if [[ $result == "success" || $result == "skipped" ]]; then | |
exit 0 | |
else | |
exit 1 | |
fi | |
vlab: | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-vlab') }} | |
runs-on: vlab-h | |
needs: | |
- test | |
- builds | |
timeout-minutes: 120 | |
strategy: | |
fail-fast: false | |
matrix: | |
fabricmode: | |
- spine-leaf | |
gateway: | |
- false | |
includeonie: | |
- false | |
buildmode: | |
- usb | |
- iso | |
- manual | |
include: | |
- fabricmode: collapsed-core | |
includeonie: false | |
gateway: false | |
buildmode: iso | |
- fabricmode: spine-leaf | |
gateway: false | |
includeonie: true | |
buildmode: usb | |
- fabricmode: spine-leaf | |
gateway: false | |
includeonie: true | |
buildmode: iso | |
- fabricmode: spine-leaf | |
gateway: true | |
includeonie: false | |
buildmode: iso | |
env: | |
slug: "${{ matrix.fabricmode }}-${{ matrix.gateway }}-${{ matrix.includeonie }}-${{ matrix.buildmode }}" | |
# TODO enable for scheduled (github.event_name == 'schedule'), master and release branches? | |
run_release_test: ${{ inputs.run_release_test == 'true' || contains(github.event.pull_request.labels.*.name, 'release-test') }} | |
steps: | |
- name: Runner host | |
run: | | |
echo "$KUBE_NODE" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
- name: Setup local registry | |
run: | | |
just --timestamp _localreg & | |
- name: Build hhfab | |
run: | | |
just --timestamp oci_repo=127.0.0.1:30000 oci=http push | |
- name: hhfab release test | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
if: ${{ env.run_release_test == 'true' }} | |
run: | | |
bin/hhfab init -v --dev -m ${{ matrix.fabricmode }} --include-onie=${{ matrix.includeonie }} --gateway=${{ matrix.gateway }} | |
bin/hhfab vlab gen -v | |
export HHFAB_JOIN_TOKEN=$(openssl rand -base64 24) | |
bin/hhfab vlab up -v --ready inspect --ready setup-vpcs --ready test-connectivity --ready release-test --ready exit --mode=${{ matrix.buildmode }} | |
cat release-test.xml | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
if: ${{ env.run_release_test == 'true' && !cancelled()}} | |
with: | |
name: Test Results for vlab--${{ env.slug }} | |
path: release-test.xml | |
- name: hhfab init and vlab up | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
if: ${{ env.run_release_test != 'true' }} | |
run: | | |
bin/hhfab init -v --dev -m ${{ matrix.fabricmode }} --include-onie=${{ matrix.includeonie }} --gateway=${{ matrix.gateway }} | |
bin/hhfab vlab gen -v | |
export HHFAB_JOIN_TOKEN=$(openssl rand -base64 24) | |
bin/hhfab vlab up -v --ready inspect --ready setup-vpcs --ready test-connectivity --ready exit --mode=${{ matrix.buildmode }} | |
- name: Upload show-tech artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: vlab--${{ env.slug }}--show-tech | |
path: show-tech-output | |
- name: Upload local registry logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: vlab--${{ env.slug }}--registry | |
path: .zot/log | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true | |
vlab-upgrade: | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-vlab') }} | |
runs-on: vlab-h | |
needs: | |
- test | |
- builds | |
timeout-minutes: 90 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- fabricmode: spine-leaf | |
fromversion: "beta-1" | |
fromflags: "--usb" | |
- fabricmode: spine-leaf | |
fromversion: "24.09" | |
fromflags: "-m=iso" | |
- fabricmode: spine-leaf | |
fromversion: "dev" | |
fromflags: "-m=iso" | |
env: | |
slug: "${{ matrix.fabricmode }}-${{ matrix.fromversion }}-${{ matrix.fromflags == '--usb' && 'usb' || matrix.fromflags == '-m=iso' && 'iso' }}" | |
steps: | |
- name: Runner host | |
run: | | |
echo "$KUBE_NODE" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
- name: Setup local registry | |
run: | | |
just --timestamp _localreg & | |
- name: Initial VLAB with old version | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
run: | | |
mkdir old | |
curl -fsSL https://i.hhdev.io/hhfab | USE_SUDO=false INSTALL_DIR=./old VERSION="${{ matrix.fromversion }}" bash | |
old/hhfab init -v --dev -m ${{ matrix.fabricmode }} --include-onie=true | |
old/hhfab vlab gen -v | |
old/hhfab vlab up -v --ready setup-vpcs --ready test-connectivity --ready exit ${{ matrix.fromflags }} | |
- name: Upload show-tech artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: vlab-upgrade--${{ env.slug }}--0-before--show-tech | |
path: show-tech-output | |
- name: Build current hhfab | |
run: | | |
just --timestamp oci_repo=127.0.0.1:30000 oci=http push | |
- name: hhfab vlab up --upgrade | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
run: | | |
bin/hhfab vlab up -v --ready inspect --ready setup-vpcs --ready test-connectivity --ready exit --upgrade | |
- name: Upload show-tech artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: vlab-upgrade--${{ env.slug }}--1-curr--show-tech | |
path: show-tech-output | |
- name: hhfab vlab up after upgrade | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
run: | | |
bin/hhfab vlab up -v --ready wait --ready exit -m=manual | |
- name: Upload show-tech artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: vlab-upgrade--${{ env.slug }}--2-after--show-tech | |
path: show-tech-output | |
- name: Upload local registry logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: vlab-upgrade--${{ env.slug }}--registry | |
path: .zot/log | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true | |
vlabs: | |
runs-on: ubuntu-latest | |
needs: | |
- vlab | |
- vlab-upgrade | |
if: ${{ always() }} | |
steps: | |
- run: | | |
result="${{ needs.vlab.result }}" | |
if [[ $result == "success" || $result == "skipped" ]]; then | |
exit 0 | |
else | |
exit 1 | |
fi | |
hlab: | |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-hlab') }} | |
runs-on: hlab | |
needs: | |
- test | |
- builds | |
timeout-minutes: 210 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- fabricmode: spine-leaf | |
includeonie: true | |
buildmode: iso | |
env: | |
slug: "${{ matrix.fabricmode }}-${{ matrix.includeonie }}-${{ matrix.buildmode }}" | |
# TODO enable for scheduled (github.event_name == 'schedule'), master and release branches? | |
run_release_test: ${{ inputs.run_release_test == 'true' || contains(github.event.pull_request.labels.*.name, 'release-test') }} | |
steps: | |
- name: Runner host | |
run: | | |
echo "$KUBE_NODE" | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Checkout lab-ci repository | |
uses: actions/checkout@v4 | |
with: | |
repository: githedgehog/lab-ci | |
path: './lab-ci' | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
- name: Setup local registry | |
run: | | |
just --timestamp _localreg & | |
- name: Build hhfab | |
run: | | |
just --timestamp oci_repo=127.0.0.1:30000 oci=http push | |
- name: hhfab release test | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
if: ${{ env.run_release_test == 'true' }} | |
run: | | |
source "./lab-ci/envs/$KUBE_NODE/source.sh" | |
bin/hhfab init -v --dev --include-onie=${{ matrix.includeonie }} -w "./lab-ci/envs/$KUBE_NODE/wiring.yaml" | |
bin/hhfab vlab up -v --ready switch-reinstall --ready inspect --ready setup-vpcs --ready test-connectivity --ready release-test --ready exit --mode=${{ matrix.buildmode }} | |
cat release-test.xml | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
if: ${{ env.run_release_test == 'true' && !cancelled()}} | |
with: | |
name: Test Results for hlab--${{ env.slug }} | |
path: release-test.xml | |
- name: hhfab basic test-connectivity | |
env: | |
HHFAB_REG_REPO: 127.0.0.1:30000 | |
HHFAB_VLAB_COLLECT: true | |
if: ${{ env.run_release_test != 'true' }} | |
run: | | |
source "./lab-ci/envs/$KUBE_NODE/source.sh" | |
bin/hhfab init -v --dev --include-onie=${{ matrix.includeonie }} -w "./lab-ci/envs/$KUBE_NODE/wiring.yaml" | |
# TODO: make controls restricted again when we figure out how to get NTP upstream working for isolated VMs | |
bin/hhfab vlab up -v --ready switch-reinstall --ready inspect --ready setup-vpcs --ready test-connectivity --ready exit --mode=${{ matrix.buildmode }} --controls-restricted=false | |
- name: Upload show-tech artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: hlab--${{ env.slug }}--show-tech | |
path: show-tech-output | |
- name: Upload local registry logs | |
uses: actions/upload-artifact@v4 | |
if: ${{ always() }} | |
with: | |
name: hlab--${{ env.slug }}--registry | |
path: .zot/log | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 120 | |
with: | |
limit-access-to-actor: true | |
hlabs: | |
runs-on: ubuntu-latest | |
needs: | |
- hlab | |
if: ${{ always() }} | |
steps: | |
- run: | | |
result="${{ needs.hlab.result }}" | |
if [[ $result == "success" || $result == "skipped" ]]; then | |
exit 0 | |
else | |
exit 1 | |
fi | |
publish-test-results: | |
if: inputs.run_release_test == 'true' || contains(github.event.pull_request.labels.*.name, 'release-test') | |
runs-on: lab | |
needs: | |
- vlab | |
- hlab | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
with: | |
files: "artifacts/**/release-test.xml" | |
publish-release: | |
runs-on: lab-h | |
if: startsWith(github.event.ref, 'refs/tags/v') && github.event_name == 'push' | |
needs: | |
- build | |
- build-multi | |
- vlab | |
- vlab-upgrade | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
# - name: Cache dev tools | |
# uses: actions/cache@v3 | |
# with: | |
# path: bin | |
# key: bin-${{ hashFiles('hack/tools.mk') }} | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish Images, Helm charts and Bins on release | |
run: | | |
just --timestamp oci_repo=ghcr.io push push-multi | |
- name: Create GH Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
make_latest: true # TODO do it for master only | |
files: | | |
bin/hhfab-*.tar.gz | |
bin/hhfabctl-*.tar.gz | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true | |
publish-master: | |
runs-on: lab-h | |
if: github.event.ref == 'refs/heads/master' && github.event_name == 'push' | |
needs: | |
- build | |
- build-multi | |
- vlab | |
- vlab-upgrade | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: stable | |
cache: true | |
# - name: Cache dev tools | |
# uses: actions/cache@v3 | |
# with: | |
# path: bin | |
# key: bin-${{ hashFiles('hack/tools.mk') }} | |
- name: Login to ghcr.io | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish Images, Helm charts and Bins for master | |
run: | | |
just --timestamp oci_repo=ghcr.io version_extra=-master push push-multi | |
- name: Setup tmate session for debug | |
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }} | |
uses: mxschmitt/action-tmate@v3 | |
timeout-minutes: 30 | |
with: | |
limit-access-to-actor: true |