Cleanup post transfer #13
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/CD Pipeline | |
| permissions: | |
| actions: read | |
| contents: read | |
| on: | |
| push: | |
| branches: [ main ] | |
| pull_request: | |
| branches: [ main ] | |
| env: | |
| # Cache key components for better organization | |
| CACHE_KEY_PREFIX: kagent-v2 | |
| BRANCH_CACHE_KEY: ${{ github.head_ref || github.ref_name }} | |
| # Consistent builder configuration | |
| BUILDX_BUILDER_NAME: kagent-builder-v0.23.0 | |
| BUILDX_VERSION: v0.23.0 | |
| jobs: | |
| test: | |
| name: Test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v4 | |
| - name: Cache Go modules | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/go-build | |
| ~/go/pkg/mod | |
| key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
| restore-keys: | | |
| ${{ runner.os }}-go- | |
| - name: Download dependencies | |
| run: go mod download | |
| - name: Run fmt | |
| run: make fmt | |
| - name: Run vet | |
| run: make vet | |
| - name: Run tests | |
| run: make test | |
| - name: Upload coverage reports | |
| uses: codecov/codecov-action@v3 | |
| with: | |
| file: ./cover.out | |
| flags: unittests | |
| name: codecov-umbrella | |
| docker: | |
| services: | |
| registry: | |
| image: registry:2 | |
| ports: | |
| - 5001:5000 | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: linux/amd64,linux/arm64 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| with: | |
| name: ${{ env.BUILDX_BUILDER_NAME }} | |
| version: ${{ env.BUILDX_VERSION }} | |
| platforms: linux/amd64,linux/arm64 | |
| use: 'true' | |
| driver-opts: network=host | |
| - name: Build Docker image | |
| env: | |
| DOCKER_BUILD_ARGS: --push --platform linux/amd64,linux/arm64 | |
| run: make docker-build |