fix(containerd): missing runtime type #440
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: [ "develop" ] | |
| pull_request: | |
| branches: [ "develop" ] | |
| types: [opened, reopened, synchronize] | |
| workflow_dispatch: | |
| jobs: | |
| test: | |
| name: unit tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| # `make test` depends on `deps`, which downloads the embedded binaries that | |
| # internal/core/embedded references via //go:embed. Without them the test | |
| # binary fails to compile. gcc (for CGO/SQLite) is preinstalled on the runner. | |
| - name: "[execution] run unit tests with coverage" | |
| run: make test GOOS=linux GOARCH=amd64 | |
| - name: "[reporting] coverage summary" | |
| if: always() | |
| run: | | |
| if [[ -f coverage.out ]]; then | |
| echo "### Coverage" >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| go tool cover -func=coverage.out | tail -n 1 >> "$GITHUB_STEP_SUMMARY" | |
| echo '```' >> "$GITHUB_STEP_SUMMARY" | |
| fi | |
| - name: "[reporting] upload coverage artifact" | |
| if: always() | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: coverage | |
| path: coverage.out | |
| retention-days: 30 | |
| if-no-files-found: ignore | |
| lint: | |
| name: lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| # golangci-lint type-checks the packages it analyses, so the embedded | |
| # binaries must exist first (same //go:embed reason as the test job). | |
| - name: "[preparation] download embedded deps" | |
| run: make deps GOOS=linux GOARCH=amd64 | |
| # golangci-lint-action v7 pairs with golangci-lint v2 (matches the | |
| # `version: "2"` schema in .golangci.yml). Pinned to a commit SHA like the | |
| # repo's other actions; golangci-lint itself pinned for reproducible CI. | |
| - name: "[execution] run golangci-lint" | |
| uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1 | |
| with: | |
| version: v2.12.2 | |
| build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| # glibc builds | |
| - goos: linux | |
| goarch: amd64 | |
| libc: glibc | |
| build_target: build | |
| - goos: linux | |
| goarch: arm64 | |
| libc: glibc | |
| build_target: build | |
| # musl builds (required for Alpine and other musl-based distros) | |
| - goos: linux | |
| goarch: amd64 | |
| libc: musl | |
| build_target: build-musl | |
| - goos: linux | |
| goarch: arm64 | |
| libc: musl | |
| build_target: build-musl | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: "[preparation] install cross-compilation toolchains" | |
| run: sudo make install-cross-compilers${{ matrix.libc == 'musl' && ' install-musl-cross-compilers' || '' }} | |
| - name: "[execution] build the binary for ${{ matrix.goos }}/${{ matrix.goarch }} (${{ matrix.libc }})" | |
| run: make ${{ matrix.build_target }} GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} | |
| - name: "[execution] upload artifact" | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: kubesolo-${{ matrix.goos }}-${{ matrix.goarch }}${{ matrix.libc == 'musl' && '-musl' || '' }} | |
| path: ./dist/kubesolo | |
| retention-days: 30 | |
| build-kubesoloctl: | |
| name: build kubesoloctl-${{ matrix.goos }}-${{ matrix.goarch }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - goos: linux | |
| goarch: amd64 | |
| - goos: linux | |
| goarch: arm64 | |
| - goos: darwin | |
| goarch: amd64 | |
| - goos: darwin | |
| goarch: arm64 | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: "[execution] build kubesoloctl for ${{ matrix.goos }}/${{ matrix.goarch }}" | |
| run: | | |
| make build-kubesoloctl \ | |
| GOOS=${{ matrix.goos }} \ | |
| GOARCH=${{ matrix.goarch }} \ | |
| KUBESOLOCTL_OUTPUT=./dist/kubesoloctl-${{ matrix.goos }}-${{ matrix.goarch }} | |
| - name: "[execution] upload artifact" | |
| uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 | |
| with: | |
| name: kubesoloctl-${{ matrix.goos }}-${{ matrix.goarch }} | |
| path: ./dist/kubesoloctl-${{ matrix.goos }}-${{ matrix.goarch }} | |
| retention-days: 30 | |
| docker-build: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| goarch: [amd64, arm64] | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: "[preparation] install cross-compilation toolchains" | |
| run: sudo make install-cross-compilers install-musl-cross-compilers | |
| - name: "[execution] build linux/${{ matrix.goarch }} musl binary" | |
| run: make build-musl GOOS=linux GOARCH=${{ matrix.goarch }} | |
| - name: "[preparation] resolve image tag" | |
| id: image | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "push=true" >> "$GITHUB_OUTPUT" | |
| echo "tags=portainerci/kubesolo:pr-${{ github.event.pull_request.number }}-linux-${{ matrix.goarch }}" >> "$GITHUB_OUTPUT" | |
| elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/develop" ]]; then | |
| echo "push=true" >> "$GITHUB_OUTPUT" | |
| echo "tags=portainerci/kubesolo:develop-linux-${{ matrix.goarch }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "push=false" >> "$GITHUB_OUTPUT" | |
| echo "tags=portainerci/kubesolo:ci-linux-${{ matrix.goarch }}" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: "[preparation] set up QEMU for cross-platform Docker builds" | |
| if: matrix.goarch == 'arm64' | |
| uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 | |
| with: | |
| platforms: linux/arm64 | |
| - name: "[preparation] set up docker buildx" | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: "[preparation] log in to docker hub" | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/develop') | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: docker.io | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: "[execution] build docker image for linux/${{ matrix.goarch }}" | |
| uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0 | |
| with: | |
| context: . | |
| platforms: linux/${{ matrix.goarch }} | |
| push: ${{ steps.image.outputs.push }} | |
| tags: ${{ steps.image.outputs.tags }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| docker-manifest: | |
| if: github.event_name == 'pull_request' || (github.event_name == 'push' && github.ref == 'refs/heads/develop') | |
| runs-on: ubuntu-latest | |
| needs: [docker-build] | |
| steps: | |
| - name: "[preparation] log in to docker hub" | |
| uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2 # v4.0.0 | |
| with: | |
| registry: docker.io | |
| username: ${{ secrets.DOCKER_USERNAME }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: "[preparation] set up docker buildx" | |
| uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0 | |
| - name: "[preparation] resolve manifest tag" | |
| id: manifest | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=develop" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: "[execution] create and push multi-arch manifest" | |
| run: | | |
| docker buildx imagetools create \ | |
| -t portainerci/kubesolo:${{ steps.manifest.outputs.tag }} \ | |
| portainerci/kubesolo:${{ steps.manifest.outputs.tag }}-linux-amd64 \ | |
| portainerci/kubesolo:${{ steps.manifest.outputs.tag }}-linux-arm64 | |
| # ── End-to-end smoke ──────────────────────────────────────────────────────── | |
| # Boots the just-built image as a container on a NATIVE runner (no QEMU — a | |
| # full Kubernetes boot under emulation is far too slow) and runs the smoke | |
| # suite via kubesoloctl. Gated on same-repo events so the published image and | |
| # Docker Hub secrets are available. arm64 runs on develop pushes only to keep | |
| # PR-time arm64 minutes down; flip its `if` to match e2e-amd64 to run it on PRs. | |
| e2e-amd64: | |
| name: e2e (amd64) | |
| needs: [docker-manifest] | |
| if: (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'push' && github.ref == 'refs/heads/develop') | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: "[preparation] build kubesoloctl" | |
| run: make build-kubesoloctl GOOS=linux GOARCH=amd64 KUBESOLOCTL_OUTPUT=./dist/kubesoloctl | |
| - name: "[preparation] install kubectl" | |
| run: | | |
| curl -fsSLo /usr/local/bin/kubectl https://dl.k8s.io/release/v1.34.8/bin/linux/amd64/kubectl | |
| chmod +x /usr/local/bin/kubectl | |
| - name: "[preparation] resolve image tag" | |
| id: image | |
| run: | | |
| if [[ "${{ github.event_name }}" == "pull_request" ]]; then | |
| echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "tag=develop" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: "[execution] run e2e smoke suite" | |
| run: IMAGE=portainerci/kubesolo:${{ steps.image.outputs.tag }} KUBESOLOCTL=./dist/kubesoloctl test/e2e/run.sh | |
| e2e-arm64: | |
| name: e2e (arm64) | |
| needs: [docker-manifest] | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/develop' | |
| runs-on: ubuntu-24.04-arm | |
| steps: | |
| - name: "[preparation] checkout the current branch" | |
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | |
| - name: "[preparation] set up golang" | |
| uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0 | |
| with: | |
| go-version-file: go.mod | |
| cache-dependency-path: go.sum | |
| - name: "[preparation] build kubesoloctl" | |
| run: make build-kubesoloctl GOOS=linux GOARCH=arm64 KUBESOLOCTL_OUTPUT=./dist/kubesoloctl | |
| - name: "[preparation] install kubectl" | |
| run: | | |
| curl -fsSLo /usr/local/bin/kubectl https://dl.k8s.io/release/v1.34.8/bin/linux/arm64/kubectl | |
| chmod +x /usr/local/bin/kubectl | |
| - name: "[execution] run e2e smoke suite" | |
| run: IMAGE=portainerci/kubesolo:develop KUBESOLOCTL=./dist/kubesoloctl test/e2e/run.sh |