diff --git a/.github/workflows/_containerd.yml b/.github/workflows/_containerd.yml new file mode 100644 index 0000000..dfef7c1 --- /dev/null +++ b/.github/workflows/_containerd.yml @@ -0,0 +1,82 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + kvm: + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + run: + runs-on: ${{ inputs.runner }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Enable KVM + if: ${{ inputs.kvm }} + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Set up Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26.1" + + - name: Install Homebrew + if: ${{ inputs.kvm }} + run: | + NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + + - name: Install CLI deps + run: brew install ${{ inputs.kvm && 'qemu ' || '' }}kubectl docker coreutils lima + + - name: Build and Install + run: make && sudo make install + + - name: Start Colima + run: colima start --runtime containerd + + - name: Delay + run: sleep 10 + + - name: Validate Containerd + run: colima nerdctl ps && colima nerdctl info + + - name: Validate DNS + run: colima ssh -- sh -c "sudo apt-get update -y -qq && sudo apt-get install -qq dnsutils && nslookup host.docker.internal" + + - name: Build Image + run: colima nerdctl -- build integration + + - name: Run Image arm64 + run: colima nerdctl -- run --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Run Image amd64 + run: colima nerdctl -- run --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Stop + run: colima stop + + - name: Temp Delete + run: colima delete -f + + - name: Restart + run: colima start --runtime containerd + + - name: Assert runtime disk arm64 + run: colima nerdctl -- run --pull=never --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Assert runtime disk amd64 + run: colima nerdctl -- run --pull=never --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Teardown + run: colima delete --data -f diff --git a/.github/workflows/_docker.yml b/.github/workflows/_docker.yml new file mode 100644 index 0000000..a5d5906 --- /dev/null +++ b/.github/workflows/_docker.yml @@ -0,0 +1,82 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + kvm: + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + run: + runs-on: ${{ inputs.runner }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Enable KVM + if: ${{ inputs.kvm }} + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Set up Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26.1" + + - name: Install Homebrew + if: ${{ inputs.kvm }} + run: | + NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + + - name: Install CLI deps + run: brew install ${{ inputs.kvm && 'qemu ' || '' }}kubectl docker coreutils lima + + - name: Build and Install + run: make && sudo make install + + - name: Start Colima + run: colima start --runtime docker + + - name: Delay + run: sleep 10 + + - name: Validate Docker + run: docker ps && docker info + + - name: Validate DNS + run: colima ssh -- sh -c "sudo apt-get update -y -qq && sudo apt-get install -qq dnsutils && nslookup host.docker.internal" + + - name: Build Image + run: docker build integration + + - name: Run Image arm64 + run: docker run --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Run Image amd64 + run: docker run --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Stop + run: colima stop + + - name: Temp Delete + run: colima delete -f + + - name: Restart + run: colima start --runtime docker + + - name: Assert runtime disk arm64 + run: docker run --pull=never --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Assert runtime disk amd64 + run: docker run --pull=never --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a + + - name: Teardown + run: colima delete --data -f diff --git a/.github/workflows/_incus.yml b/.github/workflows/_incus.yml new file mode 100644 index 0000000..13204f0 --- /dev/null +++ b/.github/workflows/_incus.yml @@ -0,0 +1,82 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + kvm: + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + run: + runs-on: ${{ inputs.runner }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Enable KVM + if: ${{ inputs.kvm }} + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Set up Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26.1" + + - name: Install Homebrew + if: ${{ inputs.kvm }} + run: | + NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + + - name: Install CLI deps + run: brew install ${{ inputs.kvm && 'qemu ' || '' }}kubectl docker coreutils lima incus + + - name: Build and Install + run: make && sudo make install + + - name: Start Colima + run: colima start --runtime incus + + - name: Delay + run: sleep 10 + + - name: Validate Incus + run: incus version && incus list + + - name: Launch Instance + run: incus launch images:alpine/edge test-instance + + - name: Delay for instance + run: sleep 5 + + - name: Validate Instance + run: incus exec test-instance -- cat /etc/os-release + + - name: Validate DNS + run: colima ssh -- sh -c "sudo apt-get update -y -qq && sudo apt-get install -qq dnsutils && nslookup host.docker.internal" + + - name: Stop + run: colima stop + + - name: Temp Delete + run: colima delete -f + + - name: Restart + run: colima start --runtime incus + + - name: Delay for restart + run: sleep 10 + + - name: Assert instance restored + run: incus exec test-instance -- cat /etc/os-release + + - name: Teardown + run: colima delete --data -f diff --git a/.github/workflows/_kubernetes-containerd.yml b/.github/workflows/_kubernetes-containerd.yml new file mode 100644 index 0000000..5e06c76 --- /dev/null +++ b/.github/workflows/_kubernetes-containerd.yml @@ -0,0 +1,55 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + kvm: + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + run: + runs-on: ${{ inputs.runner }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Enable KVM + if: ${{ inputs.kvm }} + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Set up Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26.1" + + - name: Install Homebrew + if: ${{ inputs.kvm }} + run: | + NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + + - name: Install CLI deps + run: brew install ${{ inputs.kvm && 'qemu ' || '' }}kubectl docker coreutils lima + + - name: Build and Install + run: make && sudo make install + + - name: Start Colima + run: colima start --runtime containerd --kubernetes + + - name: Delay + run: sleep 20 + + - name: Validate Kubernetes + run: kubectl cluster-info && kubectl version && kubectl get nodes -o wide + + - name: Teardown + run: colima delete -f diff --git a/.github/workflows/_kubernetes-docker.yml b/.github/workflows/_kubernetes-docker.yml new file mode 100644 index 0000000..0fcb509 --- /dev/null +++ b/.github/workflows/_kubernetes-docker.yml @@ -0,0 +1,55 @@ +on: + workflow_call: + inputs: + runner: + required: true + type: string + kvm: + required: false + type: boolean + default: false + +permissions: + contents: read + +jobs: + run: + runs-on: ${{ inputs.runner }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Enable KVM + if: ${{ inputs.kvm }} + run: | + echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules + sudo udevadm control --reload-rules + sudo udevadm trigger --name-match=kvm + + - name: Set up Go + uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 + with: + go-version: "1.26.1" + + - name: Install Homebrew + if: ${{ inputs.kvm }} + run: | + NONINTERACTIVE=1 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + echo "/home/linuxbrew/.linuxbrew/bin" >> $GITHUB_PATH + + - name: Install CLI deps + run: brew install ${{ inputs.kvm && 'qemu ' || '' }}kubectl docker coreutils lima + + - name: Build and Install + run: make && sudo make install + + - name: Start Colima + run: colima start --runtime docker --kubernetes + + - name: Delay + run: sleep 20 + + - name: Validate Kubernetes + run: kubectl cluster-info && kubectl version && kubectl get nodes -o wide + + - name: Teardown + run: colima delete -f diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index 7732d77..0000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,279 +0,0 @@ -name: Integration - -on: - push: - tags: ["v*"] - branches: [main] - paths-ignore: - - "**/*.md" - - "**/*.nix" - - "**/*.lock" - pull_request: - branches: [main] - paths-ignore: - - "**/*.md" - - "**/*.nix" - - "**/*.lock" - workflow_dispatch: - inputs: - debug_enabled: - description: 'Debug with tmate set "debug_enabled"' - required: false - default: "false" - -jobs: - kubernetes-docker: - runs-on: macos-15-intel - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version: "1.26.1" - - - name: Install CLI deps - run: brew install kubectl docker coreutils lima - - - name: Build and Install - run: make && sudo make install - - - name: tmate debugging session - uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3.23 - with: - limit-access-to-actor: true - github-token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - - - name: Start Colima - run: colima start --runtime docker --kubernetes - - - name: Delay - run: sleep 20 - - - name: Validate Kubernetes - run: kubectl cluster-info && kubectl version && kubectl get nodes -o wide - - - name: Teardown - run: colima delete -f - - kubernetes-containerd: - runs-on: macos-15-intel - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version: "1.26.1" - - - name: Install CLI deps - run: brew install kubectl docker coreutils lima - - - name: Build and Install - run: make && sudo make install - - - name: tmate debugging session - uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3.23 - with: - limit-access-to-actor: true - github-token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - - - name: Start - run: colima start --runtime containerd --kubernetes - - - name: Delay - run: sleep 20 - - - name: Validate Kubernetes - run: kubectl cluster-info && kubectl version && kubectl get nodes -o wide - - - name: Teardown - run: colima delete -f - - docker: - runs-on: macos-15-intel - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version: "1.26.1" - - - name: Install CLI deps - run: brew install kubectl docker coreutils lima - - - name: Build and Install - run: make && sudo make install - - - name: tmate debugging session - uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3.23 - with: - limit-access-to-actor: true - github-token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - - - name: Start Colima - run: colima start --runtime docker - - - name: Delay - run: sleep 10 - - - name: Validate Docker - run: docker ps && docker info - - - name: Validate DNS - run: colima ssh -- sh -c "sudo apt-get update -y -qq && sudo apt-get install -qq dnsutils && nslookup host.docker.internal" - - - name: Build Image - run: docker build integration - - - name: Run Image arm64 - run: docker run --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Run Image amd64 - run: docker run --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Stop - run: colima stop - - - name: Temp Delete - run: colima delete -f - - - name: Restart - run: colima start --runtime docker - - - name: Assert runtime disk arm64 - run: docker run --pull=never --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Assert runtime disk amd64 - run: docker run --pull=never --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Teardown - run: colima delete --data -f - - containerd: - runs-on: macos-15-intel - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version: "1.26.1" - - - name: Install CLI deps - run: brew install kubectl docker coreutils lima - - - name: Build and Install - run: make && sudo make install - - - name: tmate debugging session - uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3.23 - with: - limit-access-to-actor: true - github-token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - - - name: Start Colima - run: colima start --runtime containerd - - - name: Delay - run: sleep 10 - - - name: Validate Containerd - run: colima nerdctl ps && colima nerdctl info - - - name: Validate DNS - run: colima ssh -- sh -c "sudo apt-get update -y -qq && sudo apt-get install -qq dnsutils && nslookup host.docker.internal" - - - name: Build Image - run: colima nerdctl -- build integration - - - name: Run Image arm64 - run: colima nerdctl -- run --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Run Image amd64 - run: colima nerdctl -- run --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Stop - run: colima stop - - - name: Temp Delete - run: colima delete -f - - - name: Restart - run: colima start --runtime containerd - - - name: Assert runtime disk arm64 - run: colima nerdctl -- run --pull=never --rm --platform=linux/arm64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Assert runtime disk amd64 - run: colima nerdctl -- run --pull=never --rm --platform=linux/amd64 ghcr.io/linuxcontainers/alpine:latest uname -a - - - name: Teardown - run: colima delete --data -f - - incus: - runs-on: macos-15-intel - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - - name: Set up Go - uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0 - with: - go-version: "1.26.1" - - - name: Install CLI deps - run: brew install kubectl docker coreutils lima incus - - - name: Build and Install - run: make && sudo make install - - - name: tmate debugging session - uses: mxschmitt/action-tmate@c0afd6f790e3a5564914980036ebf83216678101 # v3.23 - with: - limit-access-to-actor: true - github-token: ${{ secrets.GITHUB_TOKEN }} - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }} - - - name: Start Colima - run: colima start --runtime incus - - - name: Delay - run: sleep 10 - - - name: Validate Incus - run: incus version && incus list - - - name: Launch Instance - run: incus launch images:alpine/edge test-instance - - - name: Delay for instance - run: sleep 5 - - - name: Validate Instance - run: incus exec test-instance -- cat /etc/os-release - - - name: Validate DNS - run: colima ssh -- sh -c "sudo apt-get update -y -qq && sudo apt-get install -qq dnsutils && nslookup host.docker.internal" - - - name: Stop - run: colima stop - - - name: Temp Delete - run: colima delete -f - - - name: Restart - run: colima start --runtime incus - - - name: Delay for restart - run: sleep 10 - - - name: Assert instance restored - run: incus exec test-instance -- cat /etc/os-release - - - name: Teardown - run: colima delete --data -f diff --git a/.github/workflows/linux-integration.yml b/.github/workflows/linux-integration.yml new file mode 100644 index 0000000..b3b7c1c --- /dev/null +++ b/.github/workflows/linux-integration.yml @@ -0,0 +1,51 @@ +name: Integration (Linux) + +on: + push: + tags: ["v*"] + branches: [main] + paths-ignore: + - "**/*.md" + - "**/*.nix" + - "**/*.lock" + pull_request: + branches: [main] + paths-ignore: + - "**/*.md" + - "**/*.nix" + - "**/*.lock" + workflow_dispatch: + +permissions: + contents: read + +jobs: + kubernetes-docker: + uses: ./.github/workflows/_kubernetes-docker.yml + with: + runner: ubuntu-24.04 + kvm: true + + kubernetes-containerd: + uses: ./.github/workflows/_kubernetes-containerd.yml + with: + runner: ubuntu-24.04 + kvm: true + + docker: + uses: ./.github/workflows/_docker.yml + with: + runner: ubuntu-24.04 + kvm: true + + containerd: + uses: ./.github/workflows/_containerd.yml + with: + runner: ubuntu-24.04 + kvm: true + + incus: + uses: ./.github/workflows/_incus.yml + with: + runner: ubuntu-24.04 + kvm: true diff --git a/.github/workflows/macos-integration.yml b/.github/workflows/macos-integration.yml new file mode 100644 index 0000000..2b45f2d --- /dev/null +++ b/.github/workflows/macos-integration.yml @@ -0,0 +1,46 @@ +name: Integration (macOS) + +on: + push: + tags: ["v*"] + branches: [main] + paths-ignore: + - "**/*.md" + - "**/*.nix" + - "**/*.lock" + pull_request: + branches: [main] + paths-ignore: + - "**/*.md" + - "**/*.nix" + - "**/*.lock" + workflow_dispatch: + +permissions: + contents: read + +jobs: + kubernetes-docker: + uses: ./.github/workflows/_kubernetes-docker.yml + with: + runner: macos-15-intel + + kubernetes-containerd: + uses: ./.github/workflows/_kubernetes-containerd.yml + with: + runner: macos-15-intel + + docker: + uses: ./.github/workflows/_docker.yml + with: + runner: macos-15-intel + + containerd: + uses: ./.github/workflows/_containerd.yml + with: + runner: macos-15-intel + + incus: + uses: ./.github/workflows/_incus.yml + with: + runner: macos-15-intel