diff --git a/.forgejo/actions/setup-k3s/action.yml b/.forgejo/actions/setup-k3s/action.yml new file mode 100644 index 0000000..4c237b0 --- /dev/null +++ b/.forgejo/actions/setup-k3s/action.yml @@ -0,0 +1,25 @@ +# 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 + - shell: bash + name: wait for nodes ready + run: | + sleep 3 + kubectl wait --for=condition=Ready nodes --all --timeout=600s diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index 057737d..712e6c1 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -16,8 +16,8 @@ env: HELM_VERSION: v3.15.4 # renovate: datasource=github-releases depName=helm packageName=helm/helm HELM_UNITTEST_VERSION: v0.5.2 # renovate: datasource=github-releases depName=helm-unittest packageName=helm-unittest/helm-unittest HELM_CHART_TESTING_VERSION: v3.11.0 # renovate: datasource=github-releases depName=chart-testing packageName=helm/chart-testing - KIND_VERSION: v0.24.0 # renovate: datasource=github-releases depName=kind packageName=kubernetes-sigs/kind KUBECTL_VERSION: v1.31.0 # renovate: datasource=github-releases depName=kubectl packageName=kubernetes/kubernetes + CT_GITHUB_GROUPS: true jobs: lint-node: @@ -74,16 +74,18 @@ jobs: - run: ct lint --config tools/ct.yml --charts . e2e: + needs: + - lint-node + - lint-helm runs-on: k8s 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 + k3s: + - v1.27.16+k3s1 # renovate: k3s + - v1.28.12+k3s1 # renovate: k3s + - v1.29.7+k3s1 # renovate: k3s + - v1.30.3+k3s1 # renovate: k3s steps: - run: cat /etc/os-release @@ -107,14 +109,9 @@ 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 }} - run: kubectl get no -o wide diff --git a/renovate.json b/renovate.json index 0f47ba6..ac609ad 100644 --- a/renovate.json +++ b/renovate.json @@ -1,6 +1,9 @@ { "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": ["forgejo-contrib/forgejo-renovate//base.json"], + "extends": [ + "forgejo-contrib/forgejo-renovate//base.json", + "github>visualon/renovate-config//k3s.json" + ], "assignees": ["viceice"], "baseBranches": ["main", "/^maint\\/.+/"], "packageRules": [ @@ -67,13 +70,13 @@ "automerge": true }, { - "description": "Separate minor and patch updates for kindest", - "matchPackageNames": ["kindest/node"], + "description": "Separate minor and patch updates for k3s", + "matchPackageNames": ["k3s-io/k3s"], "separateMinorPatch": true }, { - "description": "Require approval and no automerge for kindest major and minor updates", - "matchPackageNames": ["kindest/node"], + "description": "Require approval and no automerge for k3s major and minor updates", + "matchPackageNames": ["k3s-io/k3s"], "matchUpdateTypes": ["major", "minor"], "dependencyDashboardApproval": true, "automerge": false @@ -122,16 +125,15 @@ }, { "customType": "regex", - "description": "Update kindest kubernetes references", + "description": "Update k3s kubernetes references", "fileMatch": ["^\\.forgejo/workflows/[^/]+\\.ya?ml$"], - "matchStrings": [ - " +- (?v\\d+\\.\\d+\\.\\d+) # renovate: kindest\\n" - ], - "depNameTemplate": "kindest/node", - "datasourceTemplate": "docker" + "matchStrings": [" +- (?.+?) # renovate: k3s\\n"], + "depNameTemplate": "k3s", + "packageNameTemplate": "k3s-io/k3s", + "datasourceTemplate": "github-releases" } ], "helm-values": { - "fileMatch": ["^ci/.+\\.yml$"] + "fileMatch": ["^ci/.+\\.ya?ml$"] } }