From 7ce3793b25f61e0142047c9e200c55f8091d333f Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Fri, 16 Aug 2024 13:51:00 +0200 Subject: [PATCH] test: try k3s --- .forgejo/actions/setup-k3s/action.yml | 20 +++++++++++++++++ .forgejo/workflows/build.yml | 32 ++++++++++++++++----------- 2 files changed, 39 insertions(+), 13 deletions(-) create mode 100644 .forgejo/actions/setup-k3s/action.yml diff --git a/.forgejo/actions/setup-k3s/action.yml b/.forgejo/actions/setup-k3s/action.yml new file mode 100644 index 0000000..727735e --- /dev/null +++ b/.forgejo/actions/setup-k3s/action.yml @@ -0,0 +1,20 @@ +# action.yml +name: setup-k3s +description: 'setup k3s' + +inputs: + version: + description: 'k3s version' + required: true + +runs: + using: 'composite' + steps: + - shell: bash + name: install k3s + run: | + curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=${INPUT_VERSION} K3S_KUBECONFIG_MODE=640 sh -s - server + echo "KUBECONFIG=/etc/rancher/k3s/k3s.yaml" >> $GITHUB_ENV + - shell: bash + name: check k3s + run: kubectl cluster-info diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 2980f5e..b9b9ec0 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -78,12 +78,14 @@ jobs: strategy: matrix: - k8s: - # from https://hub.docker.com/r/kindest/node/tags - - v1.27.16 # renovate: kindest - - v1.28.13 # renovate: kindest - - v1.29.8 # renovate: kindest - - v1.30.4 # renovate: kindest + # k8s: + # # from https://hub.docker.com/r/kindest/node/tags + # - v1.27.16 # renovate: kindest + # - v1.28.13 # renovate: kindest + # - v1.29.8 # renovate: kindest + # - v1.30.4 # renovate: kindest + k3s: + - v1.30.3+k3s1 # renovate: k3s steps: - run: cat /etc/os-release @@ -107,14 +109,18 @@ jobs: with: version: ${{ env.HELM_CHART_TESTING_VERSION }} - - uses: ./.forgejo/actions/setup-docker - - - name: Create kind cluster - uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 + - uses: ./.forgejo/actions/setup-k3s with: - node_image: kindest/node:${{ matrix.k8s }} - kubectl_version: ${{ env.KUBECTL_VERSION }} - version: ${{ env.KIND_VERSION }} + version: ${{ matrix.k3s }} + + # - uses: ./.forgejo/actions/setup-docker + + # - name: Create kind cluster + # uses: helm/kind-action@0025e74a8c7512023d06dc019c617aa3cf561fde # v1.10.0 + # with: + # node_image: kindest/node:${{ matrix.k8s }} + # kubectl_version: ${{ env.KUBECTL_VERSION }} + # version: ${{ env.KIND_VERSION }} - run: kubectl get no -o wide