|
2 | 2 | name: test
|
3 | 3 | on: pull_request
|
4 | 4 | permissions: {}
|
5 |
| - |
| 5 | +concurrency: |
| 6 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 7 | + cancel-in-progress: true |
6 | 8 | jobs:
|
7 |
| - path-filter: |
8 |
| - # Get changed files to filter jobs |
9 |
| - timeout-minutes: 30 |
10 |
| - outputs: |
11 |
| - update-aqua-checksums: ${{steps.changes.outputs.update-aqua-checksums}} |
12 |
| - renovate-config-validator: ${{steps.changes.outputs.renovate-config-validator}} |
13 |
| - ghalint: ${{steps.changes.outputs.ghalint}} |
14 |
| - runs-on: ubuntu-latest |
15 |
| - permissions: {} |
16 |
| - steps: |
17 |
| - - uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 |
18 |
| - id: changes |
19 |
| - with: |
20 |
| - filters: | |
21 |
| - update-aqua-checksums: |
22 |
| - - aqua.yaml |
23 |
| - - aqua/*.yaml |
24 |
| - - aqua-checksums.json |
25 |
| - - .github/workflows/test.yaml |
26 |
| - renovate-config-validator: |
27 |
| - - renovate.json5 |
28 |
| - ghalint: |
29 |
| - - .github/workflows/*.yaml |
30 |
| - - aqua/ghalint.yaml |
31 |
| -
|
32 |
| - ghalint: |
33 |
| - # Validate GitHub Actions Workflows by ghalint. |
34 |
| - timeout-minutes: 30 |
35 |
| - needs: path-filter |
36 |
| - if: needs.path-filter.outputs.ghalint == 'true' |
37 |
| - runs-on: ubuntu-latest |
38 |
| - permissions: {} |
39 |
| - steps: |
40 |
| - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
41 |
| - with: |
42 |
| - persist-credentials: false |
43 |
| - - uses: aquaproj/aqua-installer@e2d0136abcf70b7a2f6f505720640750557c4b33 # v3.1.1 |
44 |
| - with: |
45 |
| - aqua_version: v2.46.0 |
46 |
| - env: |
47 |
| - AQUA_GITHUB_TOKEN: ${{github.token}} |
48 |
| - - run: ghalint run |
49 |
| - env: |
50 |
| - GHALINT_LOG_COLOR: always |
51 |
| - |
52 |
| - update-aqua-checksums: |
53 |
| - # Update aqua-checksums.json and push a commit |
54 |
| - needs: path-filter |
55 |
| - permissions: |
56 |
| - contents: read # The reusable workflow requires contents:read |
57 |
| - if: | |
58 |
| - needs.path-filter.outputs.update-aqua-checksums == 'true' |
59 |
| - uses: aquaproj/update-checksum-workflow/.github/workflows/update-checksum.yaml@8bce60cc4475128360bc32f00707abb874ca4a91 # v1.0.3 |
60 |
| - with: |
61 |
| - aqua_version: v2.46.0 |
62 |
| - prune: true |
63 |
| - secrets: |
64 |
| - gh_app_id: ${{secrets.APP_ID}} |
65 |
| - gh_app_private_key: ${{secrets.APP_PRIVATE_KEY}} |
66 |
| - |
67 |
| - renovate-config-validator: |
68 |
| - # Validate Renovate Configuration by renovate-config-validator. |
69 |
| - uses: suzuki-shunsuke/renovate-config-validator-workflow/.github/workflows/validate.yaml@e8effbd185cbe3874cddef63f48b8bdcfc9ada55 # v0.2.4 |
70 |
| - needs: path-filter |
71 |
| - if: needs.path-filter.outputs.renovate-config-validator == 'true' |
72 |
| - permissions: |
73 |
| - contents: read |
74 |
| - |
75 |
| - enable-automerge: |
76 |
| - # Enable automerge to merge pull requests from Renovate automatically. |
77 |
| - timeout-minutes: 30 |
78 |
| - runs-on: ubuntu-latest |
79 |
| - needs: |
80 |
| - - status-check |
81 |
| - permissions: |
82 |
| - contents: write # For enable automerge |
83 |
| - pull-requests: write # For enable automerge |
84 |
| - # "! failure() && ! cancelled()" is required. success() returns false if dependent jobs are skipped. https://github.com/community/community/discussions/45058 |
85 |
| - # By default success() is used so we have to override success() by "! failure() && ! cancelled()" |
86 |
| - if: | |
87 |
| - ! failure() && ! cancelled() && github.event.pull_request.user.login == 'renovate[bot]' && contains(github.event.pull_request.body, ' **Automerge**: Enabled.') |
88 |
| - steps: |
89 |
| - - uses: suzuki-shunsuke/enable-auto-merge-action@ec074392e76cd1062925255cd82a86ea1c44b6fd # v0.1.0 |
90 |
| - with: |
91 |
| - pr_number: ${{github.event.pull_request.number}} |
92 |
| - merge_method: squash |
93 |
| - github_app_id: ${{secrets.APP_ID}} |
94 |
| - github_app_private_key: ${{secrets.APP_PRIVATE_KEY}} |
95 |
| - |
96 | 9 | status-check:
|
97 |
| - # This job is used for main branch's branch protection rule's status check. |
98 |
| - # If all dependent jobs succeed or are skipped this job succeeds. |
99 |
| - timeout-minutes: 30 |
100 |
| - runs-on: ubuntu-latest |
| 10 | + runs-on: ubuntu-24.04 |
| 11 | + if: failure() |
| 12 | + timeout-minutes: 10 |
| 13 | + permissions: {} |
101 | 14 | needs:
|
102 |
| - - update-aqua-checksums |
103 | 15 | - test
|
104 |
| - - ghalint |
105 |
| - - renovate-config-validator |
106 |
| - permissions: {} |
107 |
| - if: failure() |
108 | 16 | steps:
|
109 | 17 | - run: exit 1
|
110 |
| - |
111 | 18 | test:
|
112 |
| - uses: suzuki-shunsuke/go-test-workflow/.github/workflows/test.yaml@6861ea245ad10752afcba66cb71f28cf5c46ce49 # v1.1.0 |
113 |
| - with: |
114 |
| - aqua_version: v2.46.0 |
115 |
| - go-version-file: go.mod |
| 19 | + uses: ./.github/workflows/workflow_call_test.yaml |
116 | 20 | permissions:
|
117 | 21 | pull-requests: write
|
118 | 22 | contents: read
|
119 |
| - |
120 |
| - prettier: |
121 |
| - timeout-minutes: 30 |
122 |
| - runs-on: ubuntu-latest |
123 |
| - steps: |
124 |
| - - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
125 |
| - with: |
126 |
| - persist-credentials: false |
127 |
| - - run: npm i -g prettier |
128 |
| - - run: prettier -c . |
0 commit comments