Skip to content

Commit 300261a

Browse files
committed
fix(ci): group job only on pull request
1 parent 885c985 commit 300261a

16 files changed

+71
-72
lines changed

.github/workflows/check-coverage.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ on:
1818
- "CHANGELOG/**"
1919

2020
concurrency:
21-
group: ${{ github.workflow }}-${{ github.ref }}
22-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
2323

2424
env:
2525
# Common versions

.github/workflows/check-license.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
name: Check-License
22

3-
43
on:
54
workflow_dispatch:
65
push:
7-
branches: [ "main" ]
6+
branches: ["main"]
87
paths-ignore:
98
- "docs/**"
109
- "**/*.md"
1110
- "**/*.yaml"
1211
- "CHANGELOG/**"
1312
pull_request:
14-
branches: [ "*" ]
13+
branches: ["*"]
1514
paths-ignore:
1615
- "docs/**"
1716
- "**/*.md"
1817
- "**/*.yaml"
1918
- "CHANGELOG/**"
2019

2120
concurrency:
22-
group: ${{ github.workflow }}-${{ github.ref }}
23-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
2423

2524
env:
2625
# Common versions

.github/workflows/check-semgrep.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ name: Check-Semgrep
44
on:
55
workflow_dispatch:
66
push:
7-
branches: [ "main" ]
7+
branches: ["main"]
88
paths-ignore:
99
- "docs/**"
1010
- "**/*.md"
1111
- "**/*.yaml"
1212
- "CHANGELOG/**"
1313
pull_request:
14-
branches: [ "*" ]
14+
branches: ["*"]
1515
paths-ignore:
1616
- "docs/**"
1717
- "**/*.md"
1818
- "**/*.yaml"
1919
- "CHANGELOG/**"
2020

2121
concurrency:
22-
group: ${{ github.workflow }}-${{ github.ref }}
23-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
22+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
23+
cancel-in-progress: true
2424

2525
jobs:
2626
semgrep:
@@ -43,18 +43,18 @@ jobs:
4343
# Fetch project source with GitHub Actions Checkout.
4444
- uses: actions/checkout@v4
4545
# Run the "semgrep ci" command on the command line of the docker image.
46-
-
47-
run: |
46+
- run: |
4847
semgrep ci \
4948
--exclude-rule go.lang.security.audit.xss.import-text-template.import-text-template \
5049
--exclude-rule yaml.kubernetes.security.run-as-non-root.run-as-non-root \
5150
--exclude-rule yaml.github-actions.security.pull-request-target-code-checkout.pull-request-target-code-checkout \
5251
--exclude-rule yaml.github-actions.security.third-party-action-not-pinned-to-commit-sha.third-party-action-not-pinned-to-commit-sha
5352
env:
54-
# Add the rules that Semgrep uses by setting the SEMGREP_RULES environment variable.
55-
SEMGREP_RULES: p/default # more at semgrep.dev/explore
53+
# Add the rules that Semgrep uses by setting the SEMGREP_RULES environment variable.
54+
SEMGREP_RULES: p/default # more at semgrep.dev/explore
5655
57-
# Uncomment SEMGREP_TIMEOUT to set this job's timeout (in seconds):
58-
# Default timeout is 1800 seconds (30 minutes).
59-
# Set to 0 to disable the timeout.
60-
# SEMGREP_TIMEOUT: 300
56+
57+
# Uncomment SEMGREP_TIMEOUT to set this job's timeout (in seconds):
58+
# Default timeout is 1800 seconds (30 minutes).
59+
# Set to 0 to disable the timeout.
60+
# SEMGREP_TIMEOUT: 300

.github/workflows/ci-patch-image.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ on:
1010
workflow_dispatch:
1111
inputs:
1212
push_mage:
13-
description: 'Push images'
13+
description: "Push images"
1414
required: false
1515
type: boolean
1616
push:
17-
branches: [ "main" ]
17+
branches: ["main"]
1818
paths-ignore:
1919
- "docs/**"
2020
- "**/*.md"
@@ -25,7 +25,7 @@ on:
2525
- "webhooks/**"
2626
- "frontend/**"
2727
pull_request:
28-
branches: [ "*" ]
28+
branches: ["*"]
2929
paths-ignore:
3030
- "docs/**"
3131
- "CHANGELOG/**"
@@ -37,14 +37,18 @@ on:
3737
- "webhooks/**"
3838
- "frontend/**"
3939

40+
concurrency:
41+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
42+
cancel-in-progress: true
43+
4044
jobs:
4145
call_ci_workflow:
4246
uses: ./.github/workflows/import-patch-image.yml
4347
with:
4448
arch: amd64,arm64
4549

4650
container-sealos:
47-
needs: [ call_ci_workflow ]
51+
needs: [call_ci_workflow]
4852
runs-on: ubuntu-24.04
4953
permissions:
5054
contents: write

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ on:
88
workflow_dispatch:
99
inputs:
1010
push_mage:
11-
description: 'Push images'
11+
description: "Push images"
1212
required: false
1313
type: boolean
1414
push:
15-
branches: [ "main" ]
15+
branches: ["main"]
1616
paths-ignore:
1717
- "docs/**"
1818
- "**/*.md"
@@ -23,7 +23,7 @@ on:
2323
- "webhooks/**"
2424
- "frontend/**"
2525
pull_request:
26-
branches: [ "*" ]
26+
branches: ["*"]
2727
paths-ignore:
2828
- "docs/**"
2929
- "CHANGELOG/**"
@@ -36,8 +36,8 @@ on:
3636
- "frontend/**"
3737

3838
concurrency:
39-
group: ${{ github.workflow }}-${{ github.ref }}
40-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
39+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
40+
cancel-in-progress: true
4141

4242
jobs:
4343
resolve-modules:
@@ -53,7 +53,7 @@ jobs:
5353
run: bash ./scripts/resolve-modules.sh ./lifecycle
5454

5555
golangci-lint:
56-
needs: [ resolve-modules ]
56+
needs: [resolve-modules]
5757
runs-on: ubuntu-24.04
5858
strategy:
5959
fail-fast: false

.github/workflows/cloud.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ permissions:
5555
packages: write
5656

5757
concurrency:
58-
group: ${{ github.workflow }}-${{ github.ref }}
59-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
58+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
59+
cancel-in-progress: true
6060

6161
env:
6262
# Common versions

.github/workflows/controllers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,8 @@ permissions:
6969
packages: write
7070

7171
concurrency:
72-
group: ${{ github.workflow }}-${{ github.ref }}
73-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
72+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
73+
cancel-in-progress: true
7474

7575
jobs:
7676
detect-changes:

.github/workflows/e2e_k3s_multi_node.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: E2E k3s Multi Node Test
33
on:
44
workflow_dispatch:
55
pull_request:
6-
types: [ labeled ]
6+
types: [labeled]
77

88
env:
99
TERRAFORM_VERSION: "1.5.7"
@@ -19,14 +19,14 @@ jobs:
1919
target_pull: true
2020
e2e_apply_test:
2121
if: github.repository_owner == 'labring'
22-
needs: [ call_ci_workflow ]
22+
needs: [call_ci_workflow]
2323
runs-on: ubuntu-24.04
2424
permissions:
2525
issues: write
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
arch: [ arm64, amd64 ]
29+
arch: [arm64, amd64]
3030
outputs:
3131
test_arm64_result: ${{ steps.apply_test.outputs.test_arm64_result }}
3232
test_amd64_result: ${{ steps.apply_test.outputs.test_amd64_result }}
@@ -80,7 +80,7 @@ jobs:
8080
/tmp/e2e.test --ginkgo.v --ginkgo.focus="E2E_sealos_multi_node_test"
8181
echo "test_${SEALOS_TEST_ARCH}_result=success" >> "$GITHUB_OUTPUT"
8282
issue_commit:
83-
needs: [ e2e_apply_test ]
83+
needs: [e2e_apply_test]
8484
runs-on: ubuntu-24.04
8585
permissions:
8686
issues: write
@@ -93,7 +93,7 @@ jobs:
9393
AMD_TEST_RESULT: ${{ needs.e2e_apply_test.outputs.test_amd64_result == 'success' && 'Success 🎉🎉!' || '‼️ Failure' }}
9494
with:
9595
issue-number: ${{ github.event.number }}
96-
comment-author: 'github-actions[bot]'
96+
comment-author: "github-actions[bot]"
9797
repository: ${{ github.repository }}
9898
body: |
9999
🤖 says: E2E k3s multi node `ARM64` Test Result: ${{ env.ARM_TEST_RESULT }} , E2E k3s multi node `AMD64` Apply Test Result: ${{ env.AMD_TEST_RESULT }}<br/>See: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/e2e_k8s_multi_node.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: E2E k8s Multi Node Test
33
on:
44
workflow_dispatch:
55
pull_request:
6-
types: [ labeled ]
6+
types: [labeled]
77

88
env:
99
TERRAFORM_VERSION: "1.5.7"
@@ -19,14 +19,14 @@ jobs:
1919
target_pull: true
2020
e2e_apply_test:
2121
if: github.repository_owner == 'labring'
22-
needs: [ call_ci_workflow ]
22+
needs: [call_ci_workflow]
2323
runs-on: ubuntu-24.04
2424
permissions:
2525
issues: write
2626
strategy:
2727
fail-fast: false
2828
matrix:
29-
arch: [ arm64, amd64 ]
29+
arch: [arm64, amd64]
3030
outputs:
3131
test_arm64_result: ${{ steps.apply_test.outputs.test_arm64_result }}
3232
test_amd64_result: ${{ steps.apply_test.outputs.test_amd64_result }}
@@ -80,7 +80,7 @@ jobs:
8080
/tmp/e2e.test --ginkgo.v --ginkgo.focus="E2E_sealos_multi_node_test"
8181
echo "test_${SEALOS_TEST_ARCH}_result=success" >> "$GITHUB_OUTPUT"
8282
issue_commit:
83-
needs: [ e2e_apply_test ]
83+
needs: [e2e_apply_test]
8484
runs-on: ubuntu-24.04
8585
permissions:
8686
issues: write
@@ -93,7 +93,7 @@ jobs:
9393
AMD_TEST_RESULT: ${{ needs.e2e_apply_test.outputs.test_amd64_result == 'success' && 'Success 🎉🎉!' || '‼️ Failure' }}
9494
with:
9595
issue-number: ${{ github.event.number }}
96-
comment-author: 'github-actions[bot]'
96+
comment-author: "github-actions[bot]"
9797
repository: ${{ github.repository }}
9898
body: |
9999
🤖 says: E2E k8s multi node `ARM64` Test Result: ${{ env.ARM_TEST_RESULT }} , E2E k8s multi node `AMD64` Test Result: ${{ env.AMD_TEST_RESULT }}<br/>See: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}

.github/workflows/e2e_test_core.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@ name: E2E Sealos Core Test
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [ "**" ]
6+
branches: ["**"]
77
paths:
88
- ".github/workflows/e2e_test_core.yml"
99
- "lifecycle/cmd/**"
1010
- "lifecycle/pkg/**"
1111
- "lifecycle/test/**"
1212
pull_request:
13-
branches: [ "*" ]
13+
branches: ["*"]
1414
paths:
1515
- ".github/workflows/e2e_test_core.yml"
1616
- "lifecycle/cmd/**"
1717
- "lifecycle/pkg/**"
1818
- "lifecycle/test/**"
1919

2020
concurrency:
21-
group: ${{ github.workflow }}-${{ github.ref }}
22-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
21+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
22+
cancel-in-progress: true
2323

2424
jobs:
2525
call_ci_workflow:
@@ -29,12 +29,11 @@ jobs:
2929
e2e: true
3030
image: false
3131
e2e-core-test:
32-
needs: [ call_ci_workflow ]
32+
needs: [call_ci_workflow]
3333
strategy:
3434
fail-fast: false
3535
matrix:
36-
unit:
37-
[
36+
unit: [
3837
E2E_sealos_images_test,
3938
E2E_sealos_images_buildrun_test,
4039
E2E_sealos_images_buildrun_feature_test,

0 commit comments

Comments
 (0)