fix(ci): remove approval requirement for kubeopencode-dev bot PRs #416
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
| # Copyright Contributors to the KubeOpenCode project | |
| name: Push | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths-ignore: | |
| - "docs/**" | |
| - "website/**" | |
| - "*.md" | |
| - "**/*.md" | |
| - "LICENSE" | |
| - ".gitignore" | |
| env: | |
| GO_VERSION: "1.26" | |
| IMG_REGISTRY: quay.io | |
| IMG_ORG: kubeopencode | |
| IMG_NAME: kubeopencode | |
| jobs: | |
| # Detect which paths changed to conditionally build images | |
| changes: | |
| name: Detect Changes | |
| runs-on: ubuntu-latest | |
| outputs: | |
| kubeopencode: ${{ steps.filter.outputs.kubeopencode }} | |
| agent-opencode: ${{ steps.filter.outputs.agent-opencode }} | |
| agent-devbox: ${{ steps.filter.outputs.agent-devbox }} | |
| agent-attach: ${{ steps.filter.outputs.agent-attach }} | |
| helm: ${{ steps.filter.outputs.helm }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Check for changes | |
| uses: dorny/paths-filter@v4 | |
| id: filter | |
| with: | |
| filters: | | |
| kubeopencode: | |
| - 'cmd/kubeopencode/**' | |
| - 'internal/**' | |
| - 'api/**' | |
| - 'go.mod' | |
| - 'go.sum' | |
| - 'Dockerfile' | |
| agent-opencode: | |
| - 'agents/opencode/**' | |
| agent-devbox: | |
| - 'agents/devbox/**' | |
| agent-attach: | |
| - 'agents/attach/**' | |
| helm: | |
| - 'charts/kubeopencode/**' | |
| unit-test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Install UI dependencies | |
| run: cd ui && npm install | |
| - name: Run UI tests | |
| run: make ui-test | |
| - name: Build UI | |
| run: make ui-build | |
| - name: Run unit tests | |
| run: make test | |
| integration-test: | |
| name: Integration Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Run integration tests | |
| run: make integration-test | |
| e2e-test: | |
| name: "E2E (${{ matrix.label }})" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| label: | |
| - task | |
| - agent | |
| - server | |
| - "crontask || agenttemplate" | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Go | |
| uses: actions/setup-go@v6 | |
| with: | |
| go-version: ${{ env.GO_VERSION }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Build UI | |
| run: | | |
| cd ui && npm install && npm run build | |
| - name: Install Kind | |
| run: | | |
| curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.24.0/kind-linux-amd64 | |
| chmod +x ./kind | |
| sudo mv ./kind /usr/local/bin/kind | |
| - name: Install Helm | |
| run: | | |
| curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
| - name: Run e2e tests (${{ matrix.label }}) | |
| run: make e2e-setup && make e2e-test-label LABEL="${{ matrix.label }}" | |
| # Build and push kubeopencode image (only when kubeopencode code changes) | |
| build-kubeopencode: | |
| name: Build KubeOpenCode | |
| runs-on: ubuntu-latest | |
| needs: [changes, unit-test, integration-test, e2e-test] | |
| if: needs.changes.outputs.kubeopencode == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Build UI | |
| run: | | |
| cd ui && npm install && npm run build | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Quay.io | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_ROBOT_ACCOUNT }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: Build and push kubeopencode | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: . | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| tags: | | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_NAME }}:latest | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/${{ env.IMG_NAME }}:${{ github.sha }} | |
| # Build and push opencode agent (only when agents/opencode changes) | |
| build-agent-opencode: | |
| name: Build Agent OpenCode | |
| runs-on: ubuntu-latest | |
| needs: [changes, unit-test, integration-test, e2e-test] | |
| if: needs.changes.outputs.agent-opencode == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Quay.io | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_ROBOT_ACCOUNT }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: Extract OPENCODE_VERSION from agents/Makefile | |
| id: opencode-version | |
| run: echo "version=$(grep '^OPENCODE_VERSION' agents/Makefile | head -1 | sed 's/.*?= *//')" >> "$GITHUB_OUTPUT" | |
| - name: Build and push opencode agent | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./agents/opencode | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| build-args: | | |
| OPENCODE_VERSION=${{ steps.opencode-version.outputs.version }} | |
| tags: | | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/kubeopencode-agent-opencode:latest | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/kubeopencode-agent-opencode:${{ github.sha }} | |
| # Build and push devbox agent (only when agents/devbox changes) | |
| build-agent-devbox: | |
| name: Build Agent Devbox | |
| runs-on: ubuntu-latest | |
| needs: [changes, unit-test, integration-test, e2e-test] | |
| if: needs.changes.outputs.agent-devbox == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Quay.io | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_ROBOT_ACCOUNT }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: Build and push devbox agent | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./agents/devbox | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| tags: | | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/kubeopencode-agent-devbox:latest | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/kubeopencode-agent-devbox:${{ github.sha }} | |
| # Build and push attach agent (only when agents/attach or opencode changes) | |
| # The attach image depends on opencode image (copies binary via COPY --from) | |
| build-agent-attach: | |
| name: Build Agent Attach | |
| runs-on: ubuntu-latest | |
| needs: [changes, unit-test, integration-test, e2e-test] | |
| if: needs.changes.outputs.agent-attach == 'true' || needs.changes.outputs.agent-opencode == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Login to Quay.io | |
| uses: docker/login-action@v4 | |
| with: | |
| registry: quay.io | |
| username: ${{ secrets.QUAY_ROBOT_ACCOUNT }} | |
| password: ${{ secrets.QUAY_TOKEN }} | |
| - name: Build and push attach agent | |
| uses: docker/build-push-action@v7 | |
| with: | |
| context: ./agents/attach | |
| platforms: linux/amd64,linux/arm64 | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| tags: | | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/kubeopencode-agent-attach:latest | |
| ${{ env.IMG_REGISTRY }}/${{ env.IMG_ORG }}/kubeopencode-agent-attach:${{ github.sha }} | |
| # Push Helm chart (only when chart changes) | |
| push-helm-chart: | |
| name: Push Helm Chart | |
| runs-on: ubuntu-latest | |
| needs: [changes, unit-test, integration-test, e2e-test] | |
| if: needs.changes.outputs.helm == 'true' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Helm | |
| run: | | |
| curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash | |
| - name: Login to Helm registry | |
| run: | | |
| echo "${{ secrets.QUAY_TOKEN }}" | helm registry login quay.io -u ${{ secrets.QUAY_ROBOT_ACCOUNT }} --password-stdin | |
| - name: Package and push Helm chart | |
| run: | | |
| mkdir -p dist | |
| helm package charts/kubeopencode -d dist/ | |
| helm push dist/kubeopencode-*.tgz oci://quay.io/kubeopencode/helm-charts |