diff --git a/.github/workflows/integration.yaml b/.github/workflows/integration.yaml index 6a08c19f..d471a821 100644 --- a/.github/workflows/integration.yaml +++ b/.github/workflows/integration.yaml @@ -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: @@ -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: @@ -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 diff --git a/.gitignore b/.gitignore index 2cab5c61..bf04a2a9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ .env .idea +.vscode .kubeconfig **/*.pyc clab-mini-lab diff --git a/inventories/group_vars/all/images.yaml b/inventories/group_vars/all/images.yaml index 9dced9b8..6c983d79 100644 --- a/inventories/group_vars/all/images.yaml +++ b/inventories/group_vars/all/images.yaml @@ -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 ##