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
73 changes: 66 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@ concurrency:
cancel-in-progress: true

jobs:
supported-versions:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Get supported Kubernetes versions
id: set-matrix
run: |
MATRIX=$(curl -s https://endoflife.date/api/kubernetes.json | \
jq -c '[.[] | select(.eol > (now | strftime("%Y-%m-%d"))) | .cycle][:3]')
echo "matrix=${MATRIX}" >> "$GITHUB_OUTPUT"

unit:
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -83,15 +95,40 @@ jobs:
name: bink
path: bink

build-operator:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false

- name: Build operator image
run: make buildimg

- name: Save operator image
run: podman save -o operator-image.tar bootc-operator:dev

- name: Upload operator image
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: operator-image
path: operator-image.tar

e2e:
runs-on: ubuntu-latest
needs: build-bink
needs: [build-bink, build-operator, supported-versions]
timeout-minutes: 30
permissions:
contents: read
packages: write
strategy:
fail-fast: false
matrix:
kube-minor: ${{ fromJson(needs.supported-versions.outputs.matrix) }}
env:
IMAGE: ghcr.io/${{ github.repository }}
BINK_NODE_DISK_IMAGE: ghcr.io/bootc-dev/bink/node:v${{ matrix.kube-minor }}-fedora-44-disk
steps:
- name: Checkout
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
Expand Down Expand Up @@ -138,8 +175,13 @@ jobs:
- name: Start podman socket
run: systemctl --user start podman.socket

- name: Build operator image
run: make buildimg
- name: Download operator image
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: operator-image

- name: Load operator image
run: podman load -i operator-image.tar

- name: Start bink cluster
run: make start-bink
Expand All @@ -158,12 +200,29 @@ jobs:
if: always()
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: e2e-logs
name: e2e-logs-${{ matrix.kube-minor }}
path: _output/logs/
if-no-files-found: ignore

push:
if: github.event_name == 'push'
runs-on: ubuntu-latest
needs: e2e
permissions:
contents: read
packages: write
env:
IMAGE: ghcr.io/${{ github.repository }}
steps:
- name: Download operator image
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: operator-image

- name: Load operator image
run: podman load -i operator-image.tar

- name: Push to GHCR
if: github.event_name == 'push'
env:
ACTOR: ${{ github.actor }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ CONTAINER_TOOL ?= podman
BINK_CLUSTER_NAME ?= e2e
KUBECONFIG_BINK ?= ./kubeconfig-$(BINK_CLUSTER_NAME)
ARTIFACTS ?= $(abspath _output/logs)
BINK_NODE_DISK_IMAGE ?= ghcr.io/bootc-dev/bink/node:v1.35-fedora-44-disk
DEFAULT_KUBE_MINOR ?= 1.35
BINK_NODE_DISK_IMAGE ?= ghcr.io/bootc-dev/bink/node:v$(DEFAULT_KUBE_MINOR)-fedora-44-disk
BINK_LOCAL_REGISTRY_NODE_IMAGE ?= registry.cluster.local:5000/node
# YEAR defines the year value used for substituting the YEAR placeholder in the boilerplate header.
YEAR ?= $(shell date +%Y)
Expand All @@ -21,6 +22,9 @@ all: build

##@ General

print-var-%:
@echo $($*)

Comment on lines +25 to +27

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: don't really need this anymore. But fine to keep too.

.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Expand Down