Skip to content

Commit 640da08

Browse files
remove tj-actions/changed-files
1 parent d3633fa commit 640da08

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

.github/workflows/test.yml

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -17,46 +17,42 @@ jobs:
1717

1818
- name: Get all changed files excluding docs and README
1919
id: changed-files
20-
uses: tj-actions/changed-files@v45
21-
with:
22-
files_ignore: |
23-
**/*.md
24-
doc/*.{json,png,svg}
20+
run: echo "changed_files=$(git diff --name-only ${GITHUB_BASE_REF} -- . ':(exclude)**/*.md' ':(exclude)doc/*.{json,png,svg}' | wc -l)" >> "$GITHUB_OUTPUT"
2521

2622
- name: Run Revive Action by building from repository
2723
uses: morphy2k/[email protected]
28-
if: steps.changed-files.outputs.any_changed == 'true'
24+
if: steps.changed-files.outputs.changed_files > 0
2925
with:
3026
exclude: "./vendor/..."
3127
name: "Revive"
3228

3329
- name: Install kubebuilder tools
34-
if: steps.changed-files.outputs.any_changed == 'true'
30+
if: steps.changed-files.outputs.changed_files > 0
3531
run: ./hack/install-kubebuilder-tools.sh
3632

3733
- name: Generate code
38-
if: steps.changed-files.outputs.any_changed == 'true'
34+
if: steps.changed-files.outputs.changed_files > 0
3935
run: ./hack/generate-code.sh && hack/verify-codegen.sh
4036

4137
- name: Run go fmt
42-
if: steps.changed-files.outputs.any_changed == 'true'
38+
if: steps.changed-files.outputs.changed_files > 0
4339
run: go fmt ./...
4440
#run: diff -u <(echo -n) <(gofmt -d -s .)
4541

4642
- name: Run go vet
47-
if: steps.changed-files.outputs.any_changed == 'true'
43+
if: steps.changed-files.outputs.changed_files > 0
4844
run: go vet --tags=test ./...
4945

5046
- name: Install static check
51-
if: steps.changed-files.outputs.any_changed == 'true'
47+
if: steps.changed-files.outputs.changed_files > 0
5248
run: go install honnef.co/go/tools/cmd/staticcheck@latest
5349

5450
- name: Test
55-
if: steps.changed-files.outputs.any_changed == 'true'
51+
if: steps.changed-files.outputs.changed_files > 0
5652
run: sudo PATH=${PATH}:./bin ./hack/test-go.sh
5753

5854
- name: Send coverage
59-
if: steps.changed-files.outputs.any_changed == 'true'
55+
if: steps.changed-files.outputs.changed_files > 0
6056
uses: shogo82148/actions-goveralls@v1
6157
with:
6258
path-to-profile: coverage.out
@@ -87,19 +83,19 @@ jobs:
8783
doc/*.{json,png,svg}
8884
8985
- name: Install requirements
90-
if: steps.changed-files.outputs.any_changed == 'true'
86+
if: steps.changed-files.outputs.changed_files > 0
9187
run: sudo apt-get install nmap jq && ./hack/build-go.sh
9288

9389
- name: Get tools, setup KinD cluster test environment
94-
if: steps.changed-files.outputs.any_changed == 'true'
90+
if: steps.changed-files.outputs.changed_files > 0
9591
run: source hack/e2e-get-test-tools.sh && ./hack/e2e-setup-kind-cluster.sh --number-of-compute $NUMBER_OF_COMPUTE_NODES
9692

9793
- name: Clear test-cache
98-
if: steps.changed-files.outputs.any_changed == 'true'
94+
if: steps.changed-files.outputs.changed_files > 0
9995
run: go clean -testcache
10096

10197
- name: Execute golang based E2E tests
102-
if: steps.changed-files.outputs.any_changed == 'true'
98+
if: steps.changed-files.outputs.changed_files > 0
10399
env:
104100
KUBECONFIG: /home/runner/.kube/config
105101
NUMBER_OF_THRASH_ITER: 20

0 commit comments

Comments
 (0)