Skip to content

feat: add xcaddy-style custom binary builder #272

feat: add xcaddy-style custom binary builder

feat: add xcaddy-style custom binary builder #272

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GOWORK: off
OPERATOR_IMAGE: ghcr.io/${{ github.repository }}-operator:sha-${{ github.sha }}
PROXY_IMAGE: ghcr.io/${{ github.repository }}:sha-${{ github.sha }}
CADDY_IMAGE: ghcr.io/${{ github.repository }}-caddy:sha-${{ github.sha }}
CADDY_BUILDER_IMAGE: ghcr.io/${{ github.repository }}-caddy-builder:sha-${{ github.sha }}
WORKSPACE_IMAGE: ghcr.io/${{ github.repository }}-workspace:sha-${{ github.sha }}
jobs:
lint-and-test:
name: Lint, Vet, Unit Tests, Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- uses: golangci/golangci-lint-action@v9
with:
install-only: true
version: v2.7.2
- name: check
run: make check
- name: upload unit coverage
uses: actions/upload-artifact@v4
with:
name: coverage-unit
path: coverage/unit
push-helm-chart:
name: Push Helm Chart (OCI)
runs-on: ubuntu-latest
needs: [lint-and-test]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Install helm
uses: azure/setup-helm@v4
with:
version: v3.17.3
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Package and push chart
run: |
helm package charts/mcp-anything --version "0.0.0-sha.${{ github.sha }}" --app-version "${{ github.sha }}"
helm push mcp-anything-0.0.0-sha.${{ github.sha }}.tgz oci://ghcr.io/${{ github.repository_owner }}
build-image:
name: Build & Push Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
push: true
tags: ${{ env.PROXY_IMAGE }}
build-caddy-image:
name: Build & Push Caddy Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.caddy
push: true
tags: ${{ env.CADDY_IMAGE }}
build-operator-image:
name: Build & Push Operator Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.operator
push: true
tags: ${{ env.OPERATOR_IMAGE }}
build-workspace-image:
name: Build & Push Workspace Image
runs-on: ubuntu-latest
needs: [build-image]
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: examples/remote-dev/Dockerfile.workspace
push: true
tags: ${{ env.WORKSPACE_IMAGE }}
build-args: PROXY_IMAGE=${{ env.PROXY_IMAGE }}
build-caddy-builder-image:
name: Build & Push Caddy Builder Image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: Log in to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build and push
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.caddy-builder
push: true
tags: ${{ env.CADDY_BUILDER_IMAGE }}
integration-test:
name: Integration Tests
runs-on: ubuntu-latest
needs: [lint-and-test, build-image, build-caddy-image, build-operator-image, push-helm-chart]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Integration tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 10
command: make integration
env:
PROXY_IMAGE: ${{ env.PROXY_IMAGE }}
CADDY_IMAGE: ${{ env.CADDY_IMAGE }}
COVERAGE_DIR: ${{ github.workspace }}/coverage
- name: upload integration coverage
uses: actions/upload-artifact@v4
with:
name: coverage-integration
path: coverage/integration
e2e-tests:
name: E2E / ${{ matrix.name }}
runs-on: ubuntu-latest
needs: [build-image, build-operator-image, build-caddy-builder-image, build-workspace-image]
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
include:
- name: Kraken Market Data
test: TestKrakenMarketDataE2E
- name: Remote Dev Workspace
test: TestRemoteDevWorkspaceE2E
- name: Helm Chart Smoke Test
test: TestHelmChartSmokeE2E
- name: Gateway API E2E
test: TestGatewayAPIE2E
- name: Caddy Builder
test: TestCaddyBuilderE2E
- name: Kong JS Tools
test: TestKongJSToolsE2E
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Run E2E test
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
retry_wait_seconds: 10
command: make e2e
env:
PROXY_IMAGE: ${{ env.PROXY_IMAGE }}
OPERATOR_IMAGE: ${{ env.OPERATOR_IMAGE }}
E2E_TEST: ${{ matrix.test }}
WORKSPACE_IMAGE: ${{ env.WORKSPACE_IMAGE }}
CADDY_BUILDER_IMAGE: ${{ env.CADDY_BUILDER_IMAGE }}
coverage:
name: Coverage Report
runs-on: ubuntu-latest
needs: [lint-and-test, integration-test, e2e-tests]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: download unit coverage
uses: actions/download-artifact@v4
with:
name: coverage-unit
path: coverage/unit
- name: download integration coverage
uses: actions/download-artifact@v4
with:
name: coverage-integration
path: coverage/integration
- name: merge and report
run: make cover-merge cover-report
- name: upload to Codecov
uses: codecov/codecov-action@v5
with:
files: coverage/coverage.out
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}