Skip to content

Commit

Permalink
ci: concurrency test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mogyuchi committed May 15, 2024
1 parent 6edcff2 commit 2124e99
Showing 1 changed file with 20 additions and 23 deletions.
43 changes: 20 additions & 23 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,34 +1,31 @@
name: test
on:
push:
branches: ["**"]

workflow_dispatch:
inputs: # null for another event
skip:
type: choice
default: no
options:
- no
- workflow
- job
permissions: {}

concurrency:
group: ${{ github.workflow }}-workflow
cancel-in-progress: ${{ inputs.skip != 'job' }}

jobs:
test1:
if: true # test
if: ${{ inputs.skip == 'no'}}
runs-on: ubuntu-latest
steps:
- run: |
cat << 'EOF' >> $GITHUB_STEP_SUMMARY
inputs
```json
${{ toJSON(inputs) }}
```
${{ toJSON(inputs) == '{}' }}
EOF
- run: sleep 60
test2:
if: ${{ !startsWith(github.event.head_commit.message, 'chore(main):\ ')}}
concurrency:
group: ${{ github.workflow }}-job
cancel-in-progress: true
if: ${{ inputs.skip != 'job'}}
runs-on: ubuntu-latest
steps:
- run: |
echo "test2: ${{ !startsWith(github.event.head_commit.message, 'chore(main)')}}" >> $GITHUB_STEP_SUMMARY
test3:
runs-on: ubuntu-latest
steps:
- run: |
echo "test3: ${{ false == null }}" >> $GITHUB_STEP_SUMMARY
call-test:
uses: ./.github/workflows/debug.yml
- run: sleep 120

0 comments on commit 2124e99

Please sign in to comment.