put readme workflow steps in e2e test and setup CI for ACP #217
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: Go CI | |
| on: | |
| push: | |
| branches: [ "main" ] | |
| paths: | |
| - "acp/**" | |
| - ".github/workflows/go-ci.yml" | |
| pull_request: | |
| branches: [ "main" ] | |
| paths: | |
| - "acp/**" | |
| - ".github/workflows/go-ci.yml" | |
| jobs: | |
| lint: | |
| name: Lint | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| cache-dependency-path: acp/go.sum | |
| - name: Cache acp tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: acp/bin | |
| key: ${{ runner.os }}-acp-bin-${{ hashFiles('acp/Makefile') }} | |
| - name: Install golangci-lint | |
| working-directory: acp | |
| run: make golangci-lint | |
| - name: Check formatting | |
| working-directory: acp | |
| run: | | |
| make fmt | |
| if [[ -n $(git diff) ]]; then | |
| echo "::error::Code is not properly formatted. Run 'make fmt' locally." | |
| git diff | |
| exit 1 | |
| fi | |
| - name: Run linter | |
| working-directory: acp | |
| run: make lint | |
| test: | |
| name: Unit Tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| cache-dependency-path: acp/go.sum | |
| - name: Cache acp tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: acp/bin | |
| key: ${{ runner.os }}-acp-bin-${{ hashFiles('acp/Makefile') }} | |
| - name: Run tests | |
| working-directory: acp | |
| run: make test | |
| - name: Upload test coverage | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: test-coverage | |
| path: acp/cover.out | |
| retention-days: 7 | |
| build: | |
| name: Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.24' | |
| cache: true | |
| cache-dependency-path: acp/go.sum | |
| - name: Cache acp tools | |
| uses: actions/cache@v4 | |
| with: | |
| path: acp/bin | |
| key: ${{ runner.os }}-acp-bin-${{ hashFiles('acp/Makefile') }} | |
| - name: Build | |
| working-directory: acp | |
| run: make build | |
| # E2E tests are now run in a separate workflow file: .github/workflows/e2e-tests.yml | |
| # This provides several benefits: | |
| # - Faster CI for regular pushes (as E2E tests can take several minutes) | |
| # - Better isolation of test failures | |
| # - Ability to trigger E2E tests independently via workflow_dispatch | |
| # - Specialized configuration for Kubernetes components | |
| # | |
| # The e2e-tests.yml workflow addresses the previous issues: | |
| # - Uses the exact image name expected by the tests: example.com/acp:v0.0.1 | |
| # - Properly configures the KinD cluster with the expected name 'kind' | |
| # - Sets up required components like cert-manager and Prometheus | |
| # - Provides detailed diagnostic output in case of failures | |
| docker: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
| needs: [lint, test, build] | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| working-directory: acp | |
| run: make docker-build |