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
85 changes: 62 additions & 23 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,11 @@ env:
REGISTRY: ghcr.io

jobs:
test:
name: Run tests
runs-on: self-hosted

strategy:
matrix:
flavors:
- name: cumulus
- name: sonic
- name: gardener
build-mini-lab-vms-image:
name: Build mini-lab-vms image
runs-on: ubuntu-latest

steps:
- name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211
run: |
[ -d "${GITHUB_WORKSPACE}" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE}

- name: Setup Containerlab
run: |
bash -c "$(curl -sL https://get.containerlab.dev)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# set if required:
# DESIRED_VERSION: v0.59.0

- name: Log in to the container registry
uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -63,6 +44,28 @@ jobs:
cache-from: type=registry,ref=${{ env.MINI_LAB_VM_IMAGE }}
cache-to: type=inline

build-mini-lab-sonic-image:
name: Build mini-lab-sonic image
runs-on: ubuntu-latest

steps:
- name: Log in to the container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.DOCKER_REGISTRY_USER }}
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}

- name: Checkout
uses: actions/checkout@v4

- name: Make tag
run: |
IMAGE_TAG=$([ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo ${GITHUB_HEAD_REF##*/} || echo "latest")

echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:${IMAGE_TAG}" >> $GITHUB_ENV
echo "MINI_LAB_SONIC_IMAGE=ghcr.io/metal-stack/mini-lab-sonic:${IMAGE_TAG}" >> $GITHUB_ENV

- name: Build and push mini-lab-sonic container
uses: docker/build-push-action@v5
with:
Expand All @@ -71,7 +74,43 @@ jobs:
tags: ${{ env.MINI_LAB_SONIC_IMAGE }}
cache-from: type=registry,ref=${{ env.MINI_LAB_SONIC_IMAGE }}
cache-to: type=inline
if: ${{ matrix.flavors.name == 'sonic' }}

test:
name: Run tests
runs-on: self-hosted
needs:
- build-mini-lab-vms-image
- build-mini-lab-sonic-image

strategy:
matrix:
flavors:
- name: cumulus
- name: sonic
- name: gardener

steps:
- name: Gain back workspace permissions # https://github.com/actions/checkout/issues/211
run: |
[ -d "${GITHUB_WORKSPACE}" ] && sudo chown -R $USER:$USER ${GITHUB_WORKSPACE}

- name: Setup Containerlab
run: |
bash -c "$(curl -sL https://get.containerlab.dev)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# set if required:
# DESIRED_VERSION: v0.59.0

- name: Checkout
uses: actions/checkout@v4

- name: Make tag
run: |
IMAGE_TAG=$([ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo ${GITHUB_HEAD_REF##*/} || echo "latest")

echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:${IMAGE_TAG}" >> $GITHUB_ENV
echo "MINI_LAB_SONIC_IMAGE=ghcr.io/metal-stack/mini-lab-sonic:${IMAGE_TAG}" >> $GITHUB_ENV

- name: Run integration tests
shell: bash
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.env
.idea
.vscode
.kubeconfig
**/*.pyc
clab-mini-lab
Expand Down
4 changes: 4 additions & 0 deletions inventories/group_vars/all/images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ setup_yaml:
- url: https://raw.githubusercontent.com/metal-stack/releases/{{ metal_stack_release_version }}/release.yaml
meta_var: metal_stack_release

# TODO: remove these overrides again.
# see: https://github.com/metal-stack/metal-api/pull/612
metal_api_image_tag: v0.40.4

##
## for development purposes, you can override releases from our image vector here
##
Expand Down