Skip to content

Commit 7ef5e6b

Browse files
authored
Merge pull request #1307 from fluxcd/ci-improve
ci: Extract verify to Makefile
2 parents 82398b7 + ca91a05 commit 7ef5e6b

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

.github/workflows/e2e.yaml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,12 @@ jobs:
1919
- name: Run tests
2020
run: make test
2121
- name: Check if working tree is dirty
22-
run: |
23-
if [[ $(git diff --stat) != '' ]]; then
24-
git --no-pager diff
25-
echo 'run make test and commit changes'
26-
exit 1
27-
fi
22+
run: make verify
2823
- name: Build container image
2924
run: |
3025
make docker-build IMG=test/helm-controller:latest \
3126
BUILD_PLATFORMS=linux/amd64 \
32-
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \
33-
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \
34-
--load"
27+
BUILD_ARGS="--load"
3528
- name: Load test image
3629
run: kind load docker-image test/helm-controller:latest
3730
- name: Install CRDs
@@ -609,6 +602,8 @@ jobs:
609602
kubectl -n default apply -f config/testdata/crds-upgrade/create-replace
610603
kubectl -n default wait helmreleases/crds-upgrade-test --for=condition=ready --timeout=2m
611604
- name: Logs
605+
if: always()
606+
continue-on-error: true
612607
run: |
613608
kubectl -n helm-system logs deploy/source-controller
614609
kubectl -n helm-system logs deploy/helm-controller
@@ -620,5 +615,3 @@ jobs:
620615
kubectl -n helm-system get helmreleases -oyaml || true
621616
kubectl -n helm-system get all
622617
helm ls -n helm-system --all
623-
kubectl -n helm-system logs deploy/source-controller || true
624-
kubectl -n helm-system logs deploy/helm-controller || true

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,14 @@ vet:
115115
generate: controller-gen
116116
cd api; $(CONTROLLER_GEN) object:headerFile="../hack/boilerplate.go.txt" paths="./..."
117117

118+
# Verify that the working directory is clean
119+
verify: fmt
120+
@if [ ! "$$(git status --porcelain --untracked-files=no)" = "" ]; then \
121+
echo "working directory is dirty:"; \
122+
git --no-pager diff; \
123+
exit 1; \
124+
fi
125+
118126
# Build the docker image
119127
docker-build:
120128
docker buildx build \

0 commit comments

Comments
 (0)