Skip to content

Commit 6c57b62

Browse files
authored
Merge pull request #1514 from fluxcd/ci-improve
ci: Extract verify to Makefile
2 parents 2566c69 + 8ed182b commit 6c57b62

File tree

3 files changed

+12
-39
lines changed

3 files changed

+12
-39
lines changed

.github/workflows/e2e.yaml

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,12 @@ jobs:
3030
TEST_AZURE_VAULT_KEY_VERSION: ${{ secrets.TEST_AZURE_VAULT_KEY_VERSION }}
3131
run: make test
3232
- name: Check if working tree is dirty
33-
run: |
34-
if [[ $(git diff --stat) != '' ]]; then
35-
git --no-pager diff
36-
echo 'run make test and commit changes'
37-
exit 1
38-
fi
33+
run: make verify
3934
- name: Build container image
4035
run: |
4136
make docker-build IMG=test/kustomize-controller:latest \
4237
BUILD_PLATFORMS=linux/amd64 \
43-
BUILD_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache \
44-
--cache-to=type=local,dest=/tmp/.buildx-cache-new,mode=max \
45-
--load"
38+
BUILD_ARGS="--load"
4639
- name: Load test image
4740
run: kind load docker-image test/kustomize-controller:latest
4841
- name: Install CRDs
@@ -105,12 +98,9 @@ jobs:
10598
kubectl create ns oci
10699
kubectl -n oci apply -f ./config/testdata/oci
107100
kubectl -n oci wait kustomizations/oci --for=condition=ready --timeout=4m
108-
- name: Run CRDs + CRs tests
109-
run: |
110-
kubectl -n kustomize-system apply -f ./config/testdata/crds-crs
111-
kubectl -n kustomize-system wait kustomizations/certs --for=condition=ready --timeout=4m
112-
kubectl -n kustomizer-cert-test wait issuers/my-ca-issuer --for=condition=ready --timeout=1m
113101
- name: Logs
102+
if: always()
103+
continue-on-error: true
114104
run: |
115105
kubectl -n kustomize-system logs deploy/source-controller
116106
kubectl -n kustomize-system logs deploy/kustomize-controller
@@ -122,5 +112,3 @@ jobs:
122112
kubectl -n kustomize-system get all
123113
kubectl -n oci get ocirepository/oci -oyaml
124114
kubectl -n oci get kustomization/oci -oyaml
125-
kubectl -n kustomize-system logs deploy/source-controller
126-
kubectl -n kustomize-system logs deploy/kustomize-controller

Makefile

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

159+
# Verify that the working directory is clean
160+
verify: fmt
161+
@if [ ! "$$(git status --porcelain --untracked-files=no)" = "" ]; then \
162+
echo "working directory is dirty:"; \
163+
git --no-pager diff; \
164+
exit 1; \
165+
fi
166+
159167
# Build the docker image
160168
docker-build:
161169
docker buildx build \

config/testdata/crds-crs/cert-manager.yaml

Lines changed: 0 additions & 23 deletions
This file was deleted.

0 commit comments

Comments
 (0)