From 2124e99dfc7f3a1581b6acc8456efc83ac7fd1dd Mon Sep 17 00:00:00 2001 From: Mogyuchi Date: Thu, 16 May 2024 03:27:58 +0900 Subject: [PATCH] ci: concurrency test --- .github/workflows/test.yml | 43 ++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e713d34e..42ce87b03 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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