|
| 1 | +name: e2e |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + |
| 9 | +jobs: |
| 10 | + kind: |
| 11 | + runs-on: ubuntu-latest |
| 12 | + steps: |
| 13 | + - name: Checkout |
| 14 | + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 15 | + - name: Setup QEMU |
| 16 | + uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0 |
| 17 | + - name: Setup Docker Buildx |
| 18 | + id: buildx |
| 19 | + uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1 |
| 20 | + - name: Setup Go |
| 21 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 22 | + with: |
| 23 | + go-version: 1.25.x |
| 24 | + cache-dependency-path: | |
| 25 | + **/go.sum |
| 26 | + **/go.mod |
| 27 | + - name: Setup Kubernetes |
| 28 | + uses: helm/kind-action@a1b0e391336a6ee6713a0583f8c6240d70863de3 # v1.12.0 |
| 29 | + with: |
| 30 | + version: v0.30.0 |
| 31 | + cluster_name: kind |
| 32 | + - name: Setup Kustomize |
| 33 | + uses: fluxcd/pkg/actions/kustomize@main |
| 34 | + - name: Run tests |
| 35 | + run: make test |
| 36 | + - name: Check if working tree is dirty |
| 37 | + run: | |
| 38 | + if [[ $(git diff --stat) != '' ]]; then |
| 39 | + git --no-pager diff |
| 40 | + echo 'run make test and commit changes' |
| 41 | + exit 1 |
| 42 | + fi |
| 43 | + - name: Build container image |
| 44 | + run: | |
| 45 | + make docker-build IMG=test/source-watcher:latest \ |
| 46 | + BUILD_PLATFORMS=linux/amd64 \ |
| 47 | + BUILD_ARGS=--load |
| 48 | + - name: Load test image |
| 49 | + run: kind load docker-image test/source-watcher:latest |
| 50 | + - name: Deploy controllers |
| 51 | + run: | |
| 52 | + make dev-deploy IMG=test/source-watcher:latest |
| 53 | + kubectl -n source-system rollout status deploy/source-controller --timeout=1m |
| 54 | + kubectl -n source-system rollout status deploy/source-watcher --timeout=1m |
| 55 | + - name: Source composition tests |
| 56 | + run: | |
| 57 | + kubectl apply -k config/testdata/composition |
| 58 | + kubectl -n composition wait artifactgenerator -l role=test --for=condition=ready --timeout=1m |
| 59 | + kubectl -n composition get artifactgenerators -o yaml |
| 60 | + kubectl -n composition get externalartifacts -o yaml |
| 61 | + - name: Source decomposition tests |
| 62 | + run: | |
| 63 | + kubectl apply -k config/testdata/decomposition |
| 64 | + kubectl -n decomposition wait artifactgenerator -l role=test --for=condition=ready --timeout=1m |
| 65 | + kubectl -n decomposition get artifactgenerators -o yaml |
| 66 | + kubectl -n decomposition get externalartifacts -o yaml |
| 67 | + - name: Logs |
| 68 | + if: always() |
| 69 | + run: | |
| 70 | + kubectl -n source-system logs deploy/source-controller |
| 71 | + kubectl -n source-system logs deploy/source-watcher |
0 commit comments