1- on : [push, pull_request]
1+ on :
2+ pull_request :
3+ paths-ignore :
4+ - " **/*.md'"
5+ - " doc/*.{json,png,svg}"
6+ push :
7+ paths-ignore :
8+ - " **/*.md'"
9+ - " doc/*.{json,png,svg}"
10+
211name : Test
312jobs :
413 test :
@@ -15,45 +24,32 @@ jobs:
1524 with :
1625 go-version-file : go.mod
1726
18- - name : Get all changed files excluding docs and README
19- id : changed-files
20- run : git fetch --unshallow --all --tags && \
21- echo "changed_files=$(git diff --name-only ${GITHUB_BASE_REF} HEAD -- . ':(exclude)**/*.md' ':(exclude)doc/*.{json,png,svg}' | wc -l)" >> "$GITHUB_OUTPUT"
22-
2327 - name : Run Revive Action by building from repository
242825- if : steps.changed-files.outputs.changed_files > 0
2629 with :
2730 exclude : " ./vendor/..."
2831 name : " Revive"
2932
3033 - name : Install kubebuilder tools
31- if : steps.changed-files.outputs.changed_files > 0
3234 run : ./hack/install-kubebuilder-tools.sh
3335
3436 - name : Generate code
35- if : steps.changed-files.outputs.changed_files > 0
3637 run : ./hack/generate-code.sh && hack/verify-codegen.sh
3738
3839 - name : Run go fmt
39- if : steps.changed-files.outputs.changed_files > 0
4040 run : go fmt ./...
4141 # run: diff -u <(echo -n) <(gofmt -d -s .)
4242
4343 - name : Run go vet
44- if : steps.changed-files.outputs.changed_files > 0
4544 run : go vet --tags=test ./...
4645
4746 - name : Install static check
48- if : steps.changed-files.outputs.changed_files > 0
4947 run : go install honnef.co/go/tools/cmd/staticcheck@latest
5048
5149 - name : Test
52- if : steps.changed-files.outputs.changed_files > 0
5350 run : sudo PATH=${PATH}:./bin ./hack/test-go.sh
5451
5552 - name : Send coverage
56- if : steps.changed-files.outputs.changed_files > 0
5753 uses : shogo82148/actions-goveralls@v1
5854 with :
5955 path-to-profile : coverage.out
@@ -75,28 +71,16 @@ jobs:
7571 with :
7672 go-version-file : go.mod
7773
78- - name : Get all changed files excluding docs and README
79- id : changed-files
80- uses : tj-actions/changed-files@v46
81- with :
82- files_ignore : |
83- **/*.md
84- doc/*.{json,png,svg}
85-
8674 - name : Install requirements
87- if : steps.changed-files.outputs.changed_files > 0
8875 run : sudo apt-get install nmap jq && ./hack/build-go.sh
8976
9077 - name : Get tools, setup KinD cluster test environment
91- if : steps.changed-files.outputs.changed_files > 0
9278 run : source hack/e2e-get-test-tools.sh && ./hack/e2e-setup-kind-cluster.sh --number-of-compute $NUMBER_OF_COMPUTE_NODES
9379
9480 - name : Clear test-cache
95- if : steps.changed-files.outputs.changed_files > 0
9681 run : go clean -testcache
9782
9883 - name : Execute golang based E2E tests
99- if : steps.changed-files.outputs.changed_files > 0
10084 env :
10185 KUBECONFIG : /home/runner/.kube/config
10286 NUMBER_OF_THRASH_ITER : 20
0 commit comments