Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test on latest K8s and align Github Workflow Actions #151

Merged
merged 8 commits into from
Apr 5, 2024
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
32 changes: 20 additions & 12 deletions .github/workflows/pr.yaml → .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
name: Integration tests for PR

---
name: Integration Test
on:
pull_request:
branches:
- master
push:
branches:
- master

env:
REGISTRY: ghcr.io

jobs:
test:
name: Integration tests for PR
name: Run tests
runs-on: self-hosted

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: Checkout
uses: actions/checkout@v3

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

- name: Set image name
run: echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:pr-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4

- name: Make tag
run: |
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:latest" >> $GITHUB_ENV || true

- name: Build Docker image
run: |
Expand All @@ -35,7 +44,6 @@ jobs:
- name: Run integration tests
shell: bash
run: |
export MINI_LAB_VM_IMAGE=ghcr.io/metal-stack/mini-lab-vms:pr-${GITHUB_HEAD_REF##*/}
./test/ci-cleanup.sh
./test/integration.sh
env:
Expand Down
43 changes: 0 additions & 43 deletions .github/workflows/master.yaml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/release-drafter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
name: Release Drafter Action

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ else
$(error Unknown flavor $(MINI_LAB_FLAVOR))
endif

KIND_ARGS=
ifneq ($(K8S_VERSION),)
KIND_ARGS=--image kindest/node:v$(K8S_VERSION)
endif

ifeq ($(CI),true)
DOCKER_COMPOSE_TTY_ARG=-T
else
Expand Down Expand Up @@ -67,8 +72,8 @@ control-plane: control-plane-bake env
control-plane-bake:
@if ! which kind > /dev/null; then echo "kind needs to be installed"; exit 1; fi
@if ! kind get clusters | grep metal-control-plane > /dev/null; then \
kind create cluster \
--name metal-control-plane \
kind create cluster $(KIND_ARGS) \
--name metal-control-plane \
--config $(KINDCONFIG) \
--kubeconfig $(KUBECONFIG); fi

Expand All @@ -79,7 +84,7 @@ partition: partition-bake
.PHONY: partition-bake
partition-bake:
# docker pull $(MINI_LAB_VM_IMAGE)
@if ! sudo $(CONTAINERLAB) --topo $(LAB_TOPOLOGY) inspect | grep -i running > /dev/null; then \
@if ! sudo $(CONTAINERLAB) --topo $(LAB_TOPOLOGY) inspect | grep -i leaf01 > /dev/null; then \
sudo --preserve-env $(CONTAINERLAB) deploy --topo $(LAB_TOPOLOGY) --reconfigure && \
./scripts/deactivate_offloading.sh; fi

Expand Down Expand Up @@ -119,6 +124,7 @@ cleanup-control-plane:

.PHONY: cleanup-partition
cleanup-partition:
mkdir -p clab-mini-lab
sudo $(CONTAINERLAB) destroy --topo $(LAB_TOPOLOGY)

.PHONY: _privatenet
Expand Down
1 change: 0 additions & 1 deletion control-plane/kind.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ networking:
apiServerAddress: 0.0.0.0
nodes:
- role: control-plane
image: kindest/node:v1.25.11@sha256:227fa11ce74ea76a0474eeefb84cb75d8dad1b08638371ecf0e86259b35be0c8
extraPortMappings:
- containerPort: 4443
hostPort: 4443
Expand Down