Merge pull request #1213 from fluxcd/backport-1212-to-release/v1.7.x #2997
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: e2e | |
| on: | |
| pull_request: | |
| push: | |
| branches: [ 'main', 'release/**' ] | |
| jobs: | |
| kind: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read # for reading the repository code. | |
| steps: | |
| - name: Test suite setup | |
| uses: fluxcd/gha-workflows/.github/actions/[email protected] | |
| with: | |
| go-version: 1.25.x | |
| - name: Run tests | |
| run: make test | |
| - name: Check if working tree is dirty | |
| run: | | |
| if [[ $(git diff --stat) != '' ]]; then | |
| git --no-pager diff | |
| echo 'run make test and commit changes' | |
| exit 1 | |
| fi | |
| - name: Build container image | |
| run: | | |
| make docker-build IMG=test/notification-controller:latest \ | |
| BUILD_PLATFORMS=linux/amd64 \ | |
| BUILD_ARGS="--load" | |
| - name: Load test image | |
| run: kind load docker-image test/notification-controller:latest | |
| - name: Install CRDs | |
| run: make install | |
| - name: Run default status test | |
| run: | | |
| kubectl apply -f config/testdata/status-defaults | |
| for crd in receiver ; do | |
| RESULT=$(kubectl get ${crd} status-defaults -o go-template={{.status}}) | |
| EXPECTED='map[observedGeneration:-1]' | |
| if [ "${RESULT}" != "${EXPECTED}" ] ; then | |
| echo -e "${RESULT}\n\ndoes not equal\n\n${EXPECTED} for CRD ${crd}" | |
| exit 1 | |
| fi | |
| done | |
| - name: Deploy controller | |
| run: | | |
| make dev-deploy IMG=test/notification-controller:latest | |
| kubectl -n notification-system rollout status deploy/notification-controller --timeout=1m | |
| env: | |
| KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin | |
| - name: Run smoke tests | |
| run: | | |
| kubectl -n notification-system apply -f ./config/samples | |
| kubectl -n notification-system wait receiver/receiver-sample --for=condition=ready --timeout=1m | |
| - name: Logs | |
| run: | | |
| kubectl -n notification-system logs deploy/notification-controller | |
| - name: Debug failure | |
| if: failure() | |
| run: | | |
| kubectl -n notification-system get providers -oyaml | |
| kubectl -n notification-system get alerts -oyaml | |
| kubectl -n notification-system get receivers -oyaml | |
| kubectl -n notification-system logs deploy/notification-controller |