Skip to content

Commit 8bf55a0

Browse files
authored
chore(ci): update workflows (#2420)
Signed-off-by: ashing <[email protected]>
1 parent ce17223 commit 8bf55a0

File tree

11 files changed

+349
-48
lines changed

11 files changed

+349
-48
lines changed
Submodule markdown-link-check added at 0524e79

.github/actions/paths-filter

Submodule paths-filter added at de90cc6

.github/workflows/codeql-analysis.yml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,37 @@ on:
2424
pull_request:
2525
branches:
2626
- master
27-
- release-v2-dev
27+
- next
2828
- 1.8.0
2929
schedule:
3030
- cron: '25 5 * * 5'
3131

3232
jobs:
33+
changes:
34+
runs-on: ubuntu-latest
35+
outputs:
36+
go: ${{ steps.filter.outputs.go }}
37+
steps:
38+
- name: Checkout
39+
uses: actions/checkout@v4
40+
with:
41+
submodules: recursive
42+
43+
- uses: ./.github/actions/paths-filter
44+
id: filter
45+
with:
46+
token: ${{ secrets.GITHUB_TOKEN }}
47+
filters: |
48+
go:
49+
- '*.go'
50+
- '**/*.go'
3351
analyze:
3452
name: Analyze
3553
runs-on: ubuntu-latest
54+
55+
needs: changes
56+
if: |
57+
(needs.changes.outputs.go == 'true')
3658
strategy:
3759
fail-fast: false
3860
matrix:
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
name: 'Dependency Review'
20+
on:
21+
pull_request:
22+
branches:
23+
- master
24+
- next
25+
- 1.8.0
26+
27+
permissions:
28+
contents: read
29+
30+
jobs:
31+
dependency-review:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
- name: 'Dependency Review'
37+
uses: actions/dependency-review-action@v3

.github/workflows/lint-checker.yml

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
name: lint-checker-ci
20+
21+
on:
22+
push:
23+
branches:
24+
- master
25+
pull_request:
26+
branches:
27+
- master
28+
- next
29+
- 1.8.0
30+
jobs:
31+
changes:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
docs: ${{ steps.filter.outputs.docs }}
35+
go: ${{ steps.filter.outputs.go }}
36+
steps:
37+
- name: Checkout
38+
uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
42+
- uses: ./.github/actions/paths-filter
43+
id: filter
44+
with:
45+
token: ${{ secrets.GITHUB_TOKEN }}
46+
filters: |
47+
docs:
48+
- 'docs/**/*'
49+
- '*.md'
50+
go:
51+
- '*.go'
52+
- '**/*.go'
53+
- 'go.mod'
54+
- 'go.sum'
55+
- 'Makefile'
56+
- 'Dockerfile'
57+
- 'test/e2e/**/*'
58+
- 'conf/**'
59+
- 'utils/**'
60+
- ".github/**"
61+
62+
run-test:
63+
needs: changes
64+
if: |
65+
(needs.changes.outputs.go == 'true')
66+
runs-on: ubuntu-latest
67+
steps:
68+
- uses: actions/checkout@v4
69+
- name: Setup Go Env
70+
uses: actions/setup-go@v4
71+
with:
72+
go-version: '1.22'
73+
- name: run gofmt
74+
working-directory: ./
75+
run: |
76+
diffs=`gofmt -l .`
77+
if [[ -n $diffs ]]; then
78+
echo "Files are not formatted by gofmt:"
79+
echo $diffs
80+
exit 1
81+
fi
82+
markdownlint:
83+
needs: changes
84+
if: |
85+
(needs.changes.outputs.docs == 'true')
86+
name: 🍇 Markdown
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@v4
90+
- name: 🚀 Use Node.js
91+
uses: actions/setup-node@v3
92+
with:
93+
node-version: '20.7.x'
94+
- run: npm install -g [email protected]
95+
- run: markdownlint '**/*.md' --ignore node_modules --ignore CHANGELOG.md --ignore docs/en/latest/references/v2.md
96+
markdown-link-check:
97+
needs: changes
98+
if: |
99+
(needs.changes.outputs.docs == 'true')
100+
runs-on: ubuntu-latest
101+
name: Check Markdown links
102+
steps:
103+
- uses: actions/checkout@v4
104+
with:
105+
submodules: recursive
106+
- uses: ./.github/actions/markdown-link-check
107+
with:
108+
use-quiet-mode: 'yes'
109+
use-verbose-mode: 'yes'
110+
config-file: 'link-check-config.json'
111+
folder-path: 'docs/en'
112+
file-path: './README.md, ./install.md, ./test/e2e/README.md'
113+
max-depth: -1
114+
file-extension: ".md"
115+
check-modified-files-only: "no"

.github/workflows/push-docker-v2-dev.yaml

Lines changed: 0 additions & 44 deletions
This file was deleted.

.github/workflows/push-docker.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,8 @@ jobs:
2727
- name: Login to Registry
2828
uses: docker/login-action@v3
2929
with:
30-
registry: ${{ secrets.DOCKER_REGISTRY }}
31-
username: ${{ secrets.DOCKER_USERNAME }}
32-
password: ${{ secrets.DOCKER_PASSWORD }}
30+
username: ${{ secrets.DOCKERHUB_USER }}
31+
password: ${{ secrets.DOCKERHUB_TOKEN }}
3332
-
3433
name: Build and push multi-arch image
3534
env:

.github/workflows/stale.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
#
19+
name: 'Close stale issues and PRs'
20+
21+
on:
22+
workflow_dispatch:
23+
schedule:
24+
- cron: '0 1 * * *'
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
stale:
31+
permissions:
32+
issues: write # for actions/stale to close stale issues
33+
pull-requests: write # for actions/stale to close stale PRs
34+
name: Prune Stale
35+
runs-on: ubuntu-latest
36+
timeout-minutes: 10
37+
38+
steps:
39+
- uses: actions/stale@v5
40+
with:
41+
days-before-issue-stale: 90
42+
days-before-issue-close: 30
43+
stale-issue-message: >
44+
This issue has been marked as stale due to 90 days of inactivity.
45+
It will be closed in 30 days if no further activity occurs. If this issue is still
46+
relevant, please simply write any comment. Even if closed, you can still revive the
47+
issue at any time or discuss it on the [email protected] list.
48+
Thank you for your contributions.
49+
close-issue-message: >
50+
This issue has been closed due to lack of activity. If you think that
51+
is incorrect, or the issue requires additional review, you can revive the issue at
52+
any time.
53+
days-before-pr-stale: 60
54+
days-before-pr-close: 30
55+
stale-pr-message: >
56+
This pull request has been marked as stale due to 60 days of inactivity.
57+
It will be closed in 30 days if no further activity occurs. If you think
58+
that's incorrect or this pull request should instead be reviewed, please simply
59+
write any comment. Even if closed, you can still revive the PR at any time or
60+
discuss it on the [email protected] list.
61+
Thank you for your contributions.
62+
close-pr-message: >
63+
This pull request/issue has been closed due to lack of activity. If you think that
64+
is incorrect, or the pull request requires review, you can revive the PR at any time.
65+
# Issues with these labels will never be considered stale.
66+
exempt-issue-labels: 'triage/accepted,discuss,good first issue'
67+
exempt-pr-labels: 'triage/accepted'
68+
exempt-all-milestones: true
69+
stale-issue-label: 'stale'
70+
stale-pr-label: 'stale'
71+
ascending: true
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#
2+
# Licensed to the Apache Software Foundation (ASF) under one
3+
# or more contributor license agreements. See the NOTICE file
4+
# distributed with this work for additional information
5+
# regarding copyright ownership. The ASF licenses this file
6+
# to you under the Apache License, Version 2.0 (the
7+
# "License"); you may not use this file except in compliance
8+
# with the License. You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing,
13+
# software distributed under the License is distributed on an
14+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
# KIND, either express or implied. See the License for the
16+
# specific language governing permissions and limitations
17+
# under the License.
18+
19+
name: yamllint-checker
20+
21+
on:
22+
push:
23+
branches:
24+
- master
25+
pull_request:
26+
branches:
27+
- master
28+
- next
29+
- 1.8.0
30+
jobs:
31+
changes:
32+
runs-on: ubuntu-latest
33+
outputs:
34+
yaml: ${{ steps.filter.outputs.yaml }}
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
submodules: recursive
40+
41+
- uses: ./.github/actions/paths-filter
42+
id: filter
43+
with:
44+
token: ${{ secrets.GITHUB_TOKEN }}
45+
# focus on `samples/deploy` yaml files directory
46+
filters: |
47+
yaml:
48+
- 'samples/deploy/**/*'
49+
yamllint-checker:
50+
needs: changes
51+
if: |
52+
(needs.changes.outputs.yaml == 'true')
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v4
56+
- uses: actions/setup-python@v4
57+
with:
58+
python-version: '3.10'
59+
- run: pip install yamllint==1.29.0
60+
- name: 🚀 Run yamllint
61+
run: yamllint samples/deploy # focus on `samples/deploy` yaml files directory

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule ".github/actions/paths-filter"]
2+
path = .github/actions/paths-filter
3+
url = https://github.com/dorny/paths-filter.git
4+
[submodule ".github/actions/markdown-link-check"]
5+
path = .github/actions/markdown-link-check
6+
url = https://github.com/gaurav-nelson/github-action-markdown-link-check.git

0 commit comments

Comments
 (0)