Skip to content

Commit 95acc78

Browse files
authored
Merge pull request #19 from fluxcd/e2e-check-dirty
ci: Check if working tree is dirty
2 parents 0e4e3cd + 71272ef commit 95acc78

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

.github/workflows/e2e.yaml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,24 @@ jobs:
2222
- name: Setup Go
2323
uses: actions/setup-go@v2-beta
2424
with:
25-
go-version: 1.13.x
25+
go-version: 1.14.x
2626
- name: Setup Kubernetes
2727
uses: engineerd/[email protected]
2828
- name: Setup Kustomize
2929
uses: ./.github/actions/kustomize
3030
- name: Setup Kubebuilder
3131
uses: ./.github/actions/kubebuilder
32-
- name: Run tests and build image
32+
- name: Run tests
33+
run: make test
34+
env:
35+
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin
36+
- name: Check if working tree is dirty
37+
run: |
38+
if [[ $(git diff --stat) != '' ]]; then
39+
echo 'run make test and commit changes'
40+
exit 1
41+
fi
42+
- name: Build container image
3343
run: make docker-build IMG=test/source-controller:latest
3444
env:
3545
KUBEBUILDER_ASSETS: ${{ github.workspace }}/kubebuilder/bin

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ generate: controller-gen
6262
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
6363

6464
# Build the docker image
65-
docker-build: test
65+
docker-build:
6666
docker build . -t ${IMG}
6767

6868
# Push the docker image

0 commit comments

Comments
 (0)