* Skip duplicate Github Actions runs (#2929) Closes #2929 Skip conditions have been added at the step level for matrix jobs because of: https://github.com/marketplace/actions/skip-duplicate-actions#how-to-use-skip-check-with-required-matrix-jobs * Update the skip_duplicate_workflow_runs workflow Remove the `cancel_others` setting since cancelling workflow runs from outdated commits requires the `actions: write` permission.
This commit is contained in:
parent
1a3a46aba2
commit
d27820ff3f
|
@ -1,21 +1,18 @@
|
||||||
name: Rack_v2
|
name: Rack_v2
|
||||||
|
|
||||||
on:
|
on: [push, pull_request, workflow_dispatch]
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
skip_duplicate_runs:
|
||||||
|
uses: ./.github/workflows/skip_duplicate_workflow_runs.yaml
|
||||||
|
|
||||||
rack_v2:
|
rack_v2:
|
||||||
name: >-
|
name: >-
|
||||||
Rack_v2: ${{ matrix.os }} ${{ matrix.ruby }}
|
Rack_v2: ${{ matrix.os }} ${{ matrix.ruby }}
|
||||||
|
needs: skip_duplicate_runs
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
TESTOPTS: -v
|
TESTOPTS: -v
|
||||||
|
@ -35,9 +32,11 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: repo checkout
|
- name: repo checkout
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: load ruby
|
- name: load ruby
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: ruby/setup-ruby-pkgs@v1
|
uses: ruby/setup-ruby-pkgs@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
|
@ -50,18 +49,23 @@ jobs:
|
||||||
|
|
||||||
# fixes 'has a bug that prevents `required_ruby_version`'
|
# fixes 'has a bug that prevents `required_ruby_version`'
|
||||||
- name: update rubygems for Ruby 2.4 - 2.5
|
- name: update rubygems for Ruby 2.4 - 2.5
|
||||||
if: contains('2.4 2.5', matrix.ruby)
|
if: |
|
||||||
|
contains('2.4 2.5', matrix.ruby) &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
run: gem update --system 3.3.14 --no-document
|
run: gem update --system 3.3.14 --no-document
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
||||||
- name: set WERRORFLAG
|
- name: set WERRORFLAG
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV
|
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: compile
|
- name: compile
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
run: bundle exec rake compile
|
run: bundle exec rake compile
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: bundle exec rake test:all
|
run: bundle exec rake test:all
|
||||||
|
|
|
@ -1,23 +1,20 @@
|
||||||
name: ragel
|
name: ragel
|
||||||
|
|
||||||
on:
|
on: [push, pull_request, workflow_dispatch]
|
||||||
push:
|
|
||||||
paths:
|
|
||||||
- 'ext/**'
|
|
||||||
- '.github/workflows/ragel.yml'
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'ext/**'
|
|
||||||
- '.github/workflows/ragel.yml'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
skip_duplicate_runs:
|
||||||
|
uses: ./.github/workflows/skip_duplicate_workflow_runs.yaml
|
||||||
|
with:
|
||||||
|
paths: '["ext/**", ".github/workflows/ragel.yml"]'
|
||||||
|
|
||||||
ragel:
|
ragel:
|
||||||
name: >-
|
name: >-
|
||||||
ragel ${{ matrix.os }} ${{ matrix.ruby }}
|
ragel ${{ matrix.os }} ${{ matrix.ruby }}
|
||||||
|
needs: skip_duplicate_runs
|
||||||
env:
|
env:
|
||||||
PUMA_NO_RUBOCOP: true
|
PUMA_NO_RUBOCOP: true
|
||||||
PUMA_TEST_DEBUG: true
|
PUMA_TEST_DEBUG: true
|
||||||
|
@ -37,15 +34,19 @@ jobs:
|
||||||
steps:
|
steps:
|
||||||
# windows git will convert \n to \r\n
|
# windows git will convert \n to \r\n
|
||||||
- name: git config
|
- name: git config
|
||||||
if: startsWith(matrix.os, 'windows')
|
if: |
|
||||||
|
startsWith(matrix.os, 'windows') &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
run: |
|
run: |
|
||||||
git config --global core.autocrlf false
|
git config --global core.autocrlf false
|
||||||
git config --global core.eol lf
|
git config --global core.eol lf
|
||||||
|
|
||||||
- name: repo checkout
|
- name: repo checkout
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: load ruby
|
- name: load ruby
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: ruby/setup-ruby-pkgs@v1
|
uses: ruby/setup-ruby-pkgs@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
|
@ -55,6 +56,7 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
- name: check ragel generation
|
- name: check ragel generation
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
ragel --version
|
ragel --version
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
name: Skip Duplicate Workflow Runs
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
paths:
|
||||||
|
description: 'A JSON-array with path patterns'
|
||||||
|
default: '[]'
|
||||||
|
required: false
|
||||||
|
type: string
|
||||||
|
outputs:
|
||||||
|
should_skip:
|
||||||
|
description: "The output from the skip_duplicate_runs job"
|
||||||
|
value: ${{ jobs.skip_duplicate_runs.outputs.should_skip }}
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
skip_duplicate_runs:
|
||||||
|
name: 'Skip Duplicate Runs'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
outputs:
|
||||||
|
should_skip: ${{ steps.skip_check.outputs.should_skip }}
|
||||||
|
steps:
|
||||||
|
- id: skip_check
|
||||||
|
uses: fkirc/skip-duplicate-actions@v5.2.0
|
||||||
|
with:
|
||||||
|
paths_ignore: '["**.md"]'
|
||||||
|
paths: ${{ inputs.paths }}
|
||||||
|
concurrent_skipping: 'same_content_newer' # skip newer runs with same content
|
||||||
|
skip_after_successful_duplicate: 'true'
|
|
@ -1,20 +1,18 @@
|
||||||
name: Tests
|
name: Tests
|
||||||
|
|
||||||
on:
|
on: [push, pull_request, workflow_dispatch]
|
||||||
push:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
pull_request:
|
|
||||||
paths-ignore:
|
|
||||||
- '**.md'
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read # to fetch code (actions/checkout)
|
contents: read # to fetch code (actions/checkout)
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
skip_duplicate_runs:
|
||||||
|
uses: ./.github/workflows/skip_duplicate_workflow_runs.yaml
|
||||||
|
|
||||||
rubocop:
|
rubocop:
|
||||||
name: 'Rubocop linting'
|
name: 'Rubocop linting'
|
||||||
|
needs: skip_duplicate_runs
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -28,7 +26,7 @@ jobs:
|
||||||
test_mri:
|
test_mri:
|
||||||
name: >-
|
name: >-
|
||||||
MRI: ${{ matrix.os }} ${{ matrix.ruby }}${{ matrix.no-ssl }}${{ matrix.yjit }}
|
MRI: ${{ matrix.os }} ${{ matrix.ruby }}${{ matrix.no-ssl }}${{ matrix.yjit }}
|
||||||
needs: rubocop
|
needs: [rubocop, skip_duplicate_runs]
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
PUMA_TEST_DEBUG: true
|
PUMA_TEST_DEBUG: true
|
||||||
|
@ -63,9 +61,11 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: repo checkout
|
- name: repo checkout
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: load ruby
|
- name: load ruby
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: ruby/setup-ruby-pkgs@v1
|
uses: ruby/setup-ruby-pkgs@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
|
@ -78,35 +78,45 @@ jobs:
|
||||||
|
|
||||||
# fixes 'has a bug that prevents `required_ruby_version`'
|
# fixes 'has a bug that prevents `required_ruby_version`'
|
||||||
- name: update rubygems for Ruby 2.4 - 2.5
|
- name: update rubygems for Ruby 2.4 - 2.5
|
||||||
if: contains('2.4 2.5', matrix.ruby)
|
if: |
|
||||||
|
contains('2.4 2.5', matrix.ruby) &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
run: gem update --system 3.3.14 --no-document
|
run: gem update --system 3.3.14 --no-document
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
timeout-minutes: 5
|
timeout-minutes: 5
|
||||||
|
|
||||||
- name: Compile Puma without SSL support
|
- name: Compile Puma without SSL support
|
||||||
if: matrix.no-ssl == ' no SSL'
|
if: |
|
||||||
|
(matrix.no-ssl == ' no SSL') &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo 'PUMA_DISABLE_SSL=true' >> $GITHUB_ENV
|
run: echo 'PUMA_DISABLE_SSL=true' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: set WERRORFLAG
|
- name: set WERRORFLAG
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV
|
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: compile
|
- name: compile
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
run: bundle exec rake compile
|
run: bundle exec rake compile
|
||||||
|
|
||||||
- name: Use yjit
|
- name: Use yjit
|
||||||
if: matrix.yjit == ' yjit'
|
if: |
|
||||||
|
(matrix.yjit == ' yjit') &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo 'RUBYOPT=--yjit' >> $GITHUB_ENV
|
run: echo 'RUBYOPT=--yjit' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
run: bundle exec rake test:all
|
run: bundle exec rake test:all
|
||||||
|
|
||||||
test_non_mri:
|
test_non_mri:
|
||||||
name: >-
|
name: >-
|
||||||
NON-MRI: ${{ matrix.os }} ${{ matrix.ruby }}${{ matrix.no-ssl }}
|
NON-MRI: ${{ matrix.os }} ${{ matrix.ruby }}${{ matrix.no-ssl }}
|
||||||
needs: rubocop
|
needs: [rubocop, skip_duplicate_runs]
|
||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
TESTOPTS: -v
|
TESTOPTS: -v
|
||||||
|
@ -133,15 +143,19 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: repo checkout
|
- name: repo checkout
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
- name: set JAVA_HOME
|
- name: set JAVA_HOME
|
||||||
if: startsWith(matrix.os, 'macos')
|
if: |
|
||||||
|
startsWith(matrix.os, 'macos') &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo JAVA_HOME=$JAVA_HOME_11_X64 >> $GITHUB_ENV
|
echo JAVA_HOME=$JAVA_HOME_11_X64 >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: load ruby, ragel
|
- name: load ruby, ragel
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
uses: ruby/setup-ruby-pkgs@v1
|
uses: ruby/setup-ruby-pkgs@v1
|
||||||
with:
|
with:
|
||||||
ruby-version: ${{ matrix.ruby }}
|
ruby-version: ${{ matrix.ruby }}
|
||||||
|
@ -152,22 +166,28 @@ jobs:
|
||||||
timeout-minutes: 10
|
timeout-minutes: 10
|
||||||
|
|
||||||
- name: Compile Puma without SSL support
|
- name: Compile Puma without SSL support
|
||||||
if: matrix.no-ssl == ' no SSL'
|
if: |
|
||||||
|
(matrix.no-ssl == ' no SSL') &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo 'PUMA_DISABLE_SSL=true' >> $GITHUB_ENV
|
run: echo 'PUMA_DISABLE_SSL=true' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: set WERRORFLAG
|
- name: set WERRORFLAG
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV
|
run: echo 'PUMA_MAKE_WARNINGS_INTO_ERRORS=true' >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: compile
|
- name: compile
|
||||||
|
if: ${{ needs.skip_duplicate_runs.outputs.should_skip != 'true' }}
|
||||||
run: bundle exec rake compile
|
run: bundle exec rake compile
|
||||||
|
|
||||||
- name: test
|
- name: test
|
||||||
id: test
|
id: test
|
||||||
timeout-minutes: 12
|
timeout-minutes: 12
|
||||||
continue-on-error: ${{ matrix.allow-failure || false }}
|
continue-on-error: ${{ matrix.allow-failure || false }}
|
||||||
if: success() # only run if previous steps have succeeded
|
if: | # only run if previous steps have succeeded
|
||||||
|
success() &&
|
||||||
|
(needs.skip_duplicate_runs.outputs.should_skip != 'true')
|
||||||
run: bundle exec rake test:all
|
run: bundle exec rake test:all
|
||||||
|
|
||||||
- name: >-
|
- name: >-
|
||||||
|
|
Loading…
Reference in New Issue