Skip to content

Commit 2124e99

Browse files
committed
ci: concurrency test
1 parent 6edcff2 commit 2124e99

File tree

1 file changed

+20
-23
lines changed

1 file changed

+20
-23
lines changed

.github/workflows/test.yml

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
11
name: test
22
on:
3-
push:
4-
branches: ["**"]
5-
3+
workflow_dispatch:
4+
inputs: # null for another event
5+
skip:
6+
type: choice
7+
default: no
8+
options:
9+
- no
10+
- workflow
11+
- job
612
permissions: {}
713

14+
concurrency:
15+
group: ${{ github.workflow }}-workflow
16+
cancel-in-progress: ${{ inputs.skip != 'job' }}
17+
818
jobs:
919
test1:
10-
if: true # test
20+
if: ${{ inputs.skip == 'no'}}
1121
runs-on: ubuntu-latest
1222
steps:
13-
- run: |
14-
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
15-
inputs
16-
```json
17-
${{ toJSON(inputs) }}
18-
```
19-
${{ toJSON(inputs) == '{}' }}
20-
EOF
23+
- run: sleep 60
2124
test2:
22-
if: ${{ !startsWith(github.event.head_commit.message, 'chore(main):\ ')}}
25+
concurrency:
26+
group: ${{ github.workflow }}-job
27+
cancel-in-progress: true
28+
if: ${{ inputs.skip != 'job'}}
2329
runs-on: ubuntu-latest
2430
steps:
25-
- run: |
26-
echo "test2: ${{ !startsWith(github.event.head_commit.message, 'chore(main)')}}" >> $GITHUB_STEP_SUMMARY
27-
test3:
28-
runs-on: ubuntu-latest
29-
steps:
30-
- run: |
31-
echo "test3: ${{ false == null }}" >> $GITHUB_STEP_SUMMARY
32-
33-
call-test:
34-
uses: ./.github/workflows/debug.yml
31+
- run: sleep 120

0 commit comments

Comments
 (0)