Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 10 additions & 29 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
on: [push, pull_request]
on:
pull_request:
paths-ignore:
- "**/*.md'"
- "doc/*.{json,png,svg}"
push:
paths-ignore:
- "**/*.md'"
- "doc/*.{json,png,svg}"

name: Test
jobs:
test:
Expand All @@ -15,48 +24,32 @@ jobs:
with:
go-version-file: go.mod

- name: Get all changed files excluding docs and README
id: changed-files
uses: tj-actions/changed-files@v46
with:
files_ignore: |
**/*.md
doc/*.{json,png,svg}

- name: Run Revive Action by building from repository
uses: morphy2k/[email protected]
if: steps.changed-files.outputs.any_changed == 'true'
with:
exclude: "./vendor/..."
name: "Revive"

- name: Install kubebuilder tools
if: steps.changed-files.outputs.any_changed == 'true'
run: ./hack/install-kubebuilder-tools.sh

- name: Generate code
if: steps.changed-files.outputs.any_changed == 'true'
run: ./hack/generate-code.sh && hack/verify-codegen.sh

- name: Run go fmt
if: steps.changed-files.outputs.any_changed == 'true'
run: go fmt ./...
#run: diff -u <(echo -n) <(gofmt -d -s .)

- name: Run go vet
if: steps.changed-files.outputs.any_changed == 'true'
run: go vet --tags=test ./...

- name: Install static check
if: steps.changed-files.outputs.any_changed == 'true'
run: go install honnef.co/go/tools/cmd/staticcheck@latest

- name: Test
if: steps.changed-files.outputs.any_changed == 'true'
run: sudo PATH=${PATH}:./bin ./hack/test-go.sh

- name: Send coverage
if: steps.changed-files.outputs.any_changed == 'true'
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: coverage.out
Expand All @@ -78,28 +71,16 @@ jobs:
with:
go-version-file: go.mod

- name: Get all changed files excluding docs and README
id: changed-files
uses: tj-actions/changed-files@v46
with:
files_ignore: |
**/*.md
doc/*.{json,png,svg}

- name: Install requirements
if: steps.changed-files.outputs.any_changed == 'true'
run: sudo apt-get install nmap jq && ./hack/build-go.sh

- name: Get tools, setup KinD cluster test environment
if: steps.changed-files.outputs.any_changed == 'true'
run: source hack/e2e-get-test-tools.sh && ./hack/e2e-setup-kind-cluster.sh --number-of-compute $NUMBER_OF_COMPUTE_NODES

- name: Clear test-cache
if: steps.changed-files.outputs.any_changed == 'true'
run: go clean -testcache

- name: Execute golang based E2E tests
if: steps.changed-files.outputs.any_changed == 'true'
env:
KUBECONFIG: /home/runner/.kube/config
NUMBER_OF_THRASH_ITER: 20
Expand Down
Loading