Skip to content

Commit

Permalink
ci: add changes filter (#520)
Browse files Browse the repository at this point in the history
Signed-off-by: Jintao Zhang <zhangjintao9020@gmail.com>
  • Loading branch information
tao12345666333 committed May 31, 2021
1 parent 38290a2 commit 3d9fd07
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/actions/paths-filter
Submodule paths-filter added at 78ab00
21 changes: 21 additions & 0 deletions .github/workflows/e2e-test-ci.yml
Expand Up @@ -26,7 +26,28 @@ on:
branches:
- master
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- uses: ./.github/actions/paths-filter
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
docs:
- 'docs/**/*'
e2e-test:
needs: changes
if: |
(needs.changes.outputs.docs == 'false')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/golangci-lint.yml
Expand Up @@ -27,8 +27,28 @@ on:
- master

jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- uses: ./.github/actions/paths-filter
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
docs:
- 'docs/**/*'
golangci:
name: lint
needs: changes
if: |
(needs.changes.outputs.docs == 'false')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
24 changes: 24 additions & 0 deletions .github/workflows/lint-checker.yml
Expand Up @@ -26,7 +26,28 @@ on:
branches:
- master
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- uses: ./.github/actions/paths-filter
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
docs:
- 'docs/**/*'
run-test:
needs: changes
if: |
(needs.changes.outputs.docs == 'false')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -44,6 +65,9 @@ jobs:
exit 1
fi
markdownlint:
needs: changes
if: |
(needs.changes.outputs.docs == 'true')
name: 🍇 Markdown
runs-on: ubuntu-latest
steps:
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/unit-test-ci.yml
Expand Up @@ -26,7 +26,28 @@ on:
branches:
- master
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- uses: ./.github/actions/paths-filter
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
docs:
- 'docs/**/*'
run-test:
needs: changes
if: |
(needs.changes.outputs.docs == 'false')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/verify-codegen.yml
Expand Up @@ -26,7 +26,27 @@ on:
branches:
- master
jobs:
changes:
runs-on: ubuntu-latest
outputs:
docs: ${{ steps.filter.outputs.docs }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- uses: ./.github/actions/paths-filter
id: filter
with:
token: ${{ secrets.GITHUB_TOKEN }}
filters: |
docs:
- 'docs/**/*'
run-test:
needs: changes
if: |
(needs.changes.outputs.docs == 'false')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Expand Up @@ -19,3 +19,6 @@
[submodule ".github/actions/cancel-workflow-runs"]
path = .github/actions/cancel-workflow-runs
url = https://github.com/potiuk/cancel-workflow-runs
[submodule ".github/actions/paths-filter"]
path = .github/actions/paths-filter
url = https://github.com/dorny/paths-filter.git

0 comments on commit 3d9fd07

Please sign in to comment.