Skip to content

Commit

Permalink
Make hw CI job work
Browse files Browse the repository at this point in the history
Signed-off-by: Sergei Lukianov <[email protected]>
  • Loading branch information
Frostman committed Jan 15, 2025
1 parent 462abdb commit 4cbeb80
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
31 changes: 24 additions & 7 deletions .github/workflows/ci-hw.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,31 @@
name: CI
name: CI-HW

concurrency:
group: hwci-${{ github.head_ref || github.run_id }}
group: ci-hw-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

on:
pull_request:
workflow_dispatch:
inputs:
keep:
type: boolean
description: "Don't exit when done"
required: false
default: false
skip_ready:
type: boolean
description: "Skip ready checks"
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:
vlab:
hlab:
runs-on: hlab
timeout-minutes: 600

Expand All @@ -36,6 +47,12 @@ jobs:
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:
Expand All @@ -54,9 +71,9 @@ jobs:
env:
HHFAB_REG_REPO: 127.0.0.1:30000
run: |
bin/hhfab init -v --dev -m ${{ matrix.fabricmode }} --include-onie=${{ matrix.includeonie }}
bin/hhfab vlab gen -v
bin/hhfab vlab up -v --ready setup-vpcs --ready test-connectivity --ready exit --mode=${{ matrix.buildmode }}
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 ${{ inputs.skip_ready && '' || '--ready setup-vpcs --ready test-connectivity' }} ${{ inputs.keep && '' || '--ready exit' }} --mode=${{ matrix.buildmode }}
- name: Dump local registry logs
if: ${{ always() }}
Expand All @@ -66,6 +83,6 @@ jobs:
- name: Setup tmate session for debug
if: ${{ failure() && github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
uses: mxschmitt/action-tmate@v3
timeout-minutes: 30
timeout-minutes: 600
with:
limit-access-to-actor: true
1 change: 1 addition & 0 deletions cmd/hhfab/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,7 @@ func Run(ctx context.Context) error {
Aliases: []string{"mode", "m"},
Usage: "set fabric mode: one of " + strings.Join(fabricModes, ", "),
Value: string(meta.FabricModeSpineLeaf),
EnvVars: []string{"HHFAB_FABRIC_MODE"},
Action: func(_ *cli.Context, mode string) error {
if !slices.Contains(fabricModes, mode) {
return fmt.Errorf("invalid fabric mode %q", mode) //nolint:goerr113
Expand Down

0 comments on commit 4cbeb80

Please sign in to comment.