Skip to content

Commit 56c2460

Browse files
committed
ci: add test skip case
Signed-off-by: Long Dai <long0dai@foxmail.com>
1 parent d6e94d9 commit 56c2460

File tree

2 files changed

+24
-3
lines changed

2 files changed

+24
-3
lines changed

.github/workflows/components-contrib.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,32 @@ jobs:
4343
- os: macOS-latest
4444
target_arch: arm
4545
steps:
46+
- name: Check if need skip
47+
id: skip_check
48+
uses: fkirc/skip-duplicate-actions@v3.4.0
49+
with:
50+
cancel_others: 'true'
51+
paths_ignore: '["**.md", ".codecov.yaml", ".github/workflows/dapr-automerge.yml"]'
4652
- name: Set up Go ${{ env.GOVER }}
53+
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
4754
uses: actions/setup-go@v1
4855
with:
4956
go-version: ${{ env.GOVER }}
5057
- name: Check out code into the Go module directory
58+
if: ${{ steps.skip_check.outputs.should_skip != 'true' }}
5159
uses: actions/checkout@v2
5260
- name: Run golangci-lint
53-
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
61+
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' && steps.skip_check.outputs.should_skip != 'true'
5462
uses: golangci/golangci-lint-action@v2.2.1
5563
with:
5664
version: ${{ env.GOLANGCI_LINT_VER }}
5765
- name: Run go mod tidy check diff
58-
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'
66+
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux' && steps.skip_check.outputs.should_skip != 'true'
5967
run: make modtidy check-diff
6068
- name: Run make test
6169
env:
6270
COVERAGE_OPTS: "-coverprofile=coverage.txt -covermode=atomic"
63-
if: matrix.target_arch != 'arm'
71+
if: matrix.target_arch != 'arm' && steps.skip_check.outputs.should_skip != 'true'
6472
run: make test
6573
- name: Codecov
6674
if: matrix.target_arch == 'amd64' && matrix.target_os == 'linux'

.github/workflows/conformance.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,24 @@ on:
1515
- release-*
1616

1717
jobs:
18+
pre_job:
19+
name: Skip Duplicate Actions
20+
runs-on: ubuntu-latest
21+
outputs:
22+
should_skip: ${{ steps.skip_check.outputs.should_skip }}
23+
steps:
24+
- id: skip_check
25+
uses: fkirc/skip-duplicate-actions@v3.4.0
26+
with:
27+
cancel_others: 'true'
28+
paths_ignore: '["**.md", ".codecov.yaml", ".github/workflows/dapr-automerge.yml"]'
1829
# Based on whether this is a PR or a scheduled run, we will run a different
1930
# subset of the conformance tests. This allows all the tests not requiring
2031
# secrets to be executed on pull requests.
2132
generate-matrix:
2233
runs-on: ubuntu-latest
34+
needs: pre_job
35+
if: needs.pre_job.outputs.should_skip != 'true'
2336
steps:
2437
- name: Install yq
2538
run: |

0 commit comments

Comments
 (0)