refactor extract ${{ ghithub }} expressions
Use composite action to reduce copy & paste.
This commit is contained in:
parent
26b69fd407
commit
48e646fd96
Notes:
git
2023-06-29 07:58:31 +00:00
39
.github/actions/slack/action.yml
vendored
Normal file
39
.github/actions/slack/action.yml
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
name: Post a message to slack
|
||||
description: >-
|
||||
We have our ruby/action-slack webhook. However its arguments are
|
||||
bit verbose to be listed in every workflow files. Better merge them
|
||||
into one.
|
||||
|
||||
inputs:
|
||||
SLACK_WEBHOOK_URL:
|
||||
required: true
|
||||
description: >-
|
||||
The URL to post the payload. This is an input because it tends
|
||||
to be stored in a secrets valut and a composite action cannot
|
||||
look into one.
|
||||
|
||||
label:
|
||||
required: false
|
||||
description: >-
|
||||
Human-readable description of the run, something like "DEBUG=1".
|
||||
This need not be unique among runs.
|
||||
|
||||
outputs:
|
||||
# Nothing?
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
|
||||
steps:
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }}${{ inputs.label && format(' / {0}', inputs.label) }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ inputs.SLACK_WEBHOOK_URL }}
|
12
.github/workflows/annocheck.yml
vendored
12
.github/workflows/annocheck.yml
vendored
@ -142,17 +142,9 @@ jobs:
|
||||
- run: make test-annocheck
|
||||
if: ${{ matrix.entry.check && endsWith(matrix.entry.name, 'annocheck') }}
|
||||
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / ${{ matrix.entry.name }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.entry.name }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/baseruby.yml
vendored
12
.github/workflows/baseruby.yml
vendored
@ -63,16 +63,8 @@ jobs:
|
||||
- run: make incs
|
||||
- run: make all
|
||||
- run: make test
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / BASERUBY @ ${{ matrix.ruby }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.ruby }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
11
.github/workflows/bundled_gems.yml
vendored
11
.github/workflows/bundled_gems.yml
vendored
@ -123,16 +123,7 @@ jobs:
|
||||
GIT_COMMITTER_NAME: git
|
||||
if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.show.outcome == 'failure' }}
|
||||
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / update",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
12
.github/workflows/check_dependencies.yml
vendored
12
.github/workflows/check_dependencies.yml
vendored
@ -64,16 +64,8 @@ jobs:
|
||||
- run: make all golf
|
||||
- run: ruby tool/update-deps --fix
|
||||
- run: git diff --no-ext-diff --ignore-submodules --exit-code
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ matrix.os }} / Dependencies need to update",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.os }} / Dependencies need to update
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
11
.github/workflows/check_misc.yml
vendored
11
.github/workflows/check_misc.yml
vendored
@ -97,16 +97,7 @@ jobs:
|
||||
GIT_COMMITTER_NAME: git
|
||||
if: ${{ github.repository == 'ruby/ruby' && !startsWith(github.event_name, 'pull') && steps.diff.outcome == 'failure' }}
|
||||
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
12
.github/workflows/compilers.yml
vendored
12
.github/workflows/compilers.yml
vendored
@ -267,17 +267,9 @@ jobs:
|
||||
- run: make test-annocheck
|
||||
if: ${{ matrix.entry.check && endsWith(matrix.entry.name, 'annocheck') }}
|
||||
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / ${{ matrix.entry.name }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.entry.name }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/macos.yml
vendored
12
.github/workflows/macos.yml
vendored
@ -95,17 +95,9 @@ jobs:
|
||||
PRECHECK_BUNDLED_GEMS: "no"
|
||||
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }}
|
||||
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ matrix.os }} / ${{ matrix.test_task }}${{ matrix.configure }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.test_task }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/mingw.yml
vendored
12
.github/workflows/mingw.yml
vendored
@ -159,17 +159,9 @@ jobs:
|
||||
make ${{ StartsWith(matrix.test_task, 'spec/') && matrix.test_task || 'test-spec' }}
|
||||
if: ${{matrix.test_task == 'check' || matrix.test_task == 'test-spec' || StartsWith(matrix.test_task, 'spec/')}}
|
||||
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} ${{ matrix.msystem }} / ${{ matrix.test_task }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.msystem }} / ${{ matrix.test_task }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
11
.github/workflows/rjit-bindgen.yml
vendored
11
.github/workflows/rjit-bindgen.yml
vendored
@ -85,17 +85,8 @@ jobs:
|
||||
- run: make ${{ matrix.task }}
|
||||
- run: git diff --exit-code
|
||||
working-directory: src
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "RJIT / bindgen",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/rjit.yml
vendored
12
.github/workflows/rjit.yml
vendored
@ -115,17 +115,9 @@ jobs:
|
||||
env:
|
||||
GNUMAKEFLAGS: ""
|
||||
RUN_OPTS: ${{ matrix.run_opts }}
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "RJIT / ${{ matrix.run_opts }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.run_opts }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/spec_guards.yml
vendored
12
.github/workflows/spec_guards.yml
vendored
@ -46,16 +46,8 @@ jobs:
|
||||
working-directory: spec/ruby
|
||||
env:
|
||||
CHECK_LEAKS: true
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / rubyspec @ ${{ matrix.ruby }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.ruby }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
12
.github/workflows/ubuntu.yml
vendored
12
.github/workflows/ubuntu.yml
vendored
@ -127,17 +127,9 @@ jobs:
|
||||
TESTS: ${{ matrix.skipped_tests }}
|
||||
if: ${{ matrix.test_task == 'check' && matrix.skipped_tests != '' }}
|
||||
continue-on-error: ${{ matrix.continue-on-skipped_tests || false }}
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.test_task }} ${{ matrix.configure }}${{ matrix.arch }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/wasm.yml
vendored
12
.github/workflows/wasm.yml
vendored
@ -115,17 +115,9 @@ jobs:
|
||||
ruby ./bootstraptest/runner.rb --ruby="$(which wasmtime) run $PWD/../build/ruby --mapdir /::./ -- " --verbose "--sets=$NO_THREAD_TESTS"
|
||||
working-directory: src
|
||||
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / ${{ matrix.name }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.name }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
12
.github/workflows/windows.yml
vendored
12
.github/workflows/windows.yml
vendored
@ -140,17 +140,9 @@ jobs:
|
||||
env:
|
||||
RUBY_TESTOPTS: -j${{env.TEST_JOBS}} --job-status=normal
|
||||
timeout-minutes: 60
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "VS${{ matrix.vs }} / ${{ matrix.test_task || 'check' }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: VS${{ matrix.vs }} / ${{ matrix.test_task || 'check' }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
13
.github/workflows/yjit-ubuntu.yml
vendored
13
.github/workflows/yjit-ubuntu.yml
vendored
@ -158,17 +158,10 @@ jobs:
|
||||
BASE_REPO: ${{ github.event.pull_request.base.repo.full_name }}
|
||||
BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
if: ${{ matrix.test_task == 'yjit-bench' && startsWith(github.event_name, 'pull') }}
|
||||
- uses: ruby/action-slack@0bd85c72233cdbb6a0fe01d37aaeff1d21b5fce1 # v3.2.1
|
||||
|
||||
- uses: ./.github/actions/slack
|
||||
with:
|
||||
payload: |
|
||||
{
|
||||
"ci": "GitHub Actions",
|
||||
"env": "${{ github.workflow }} / ${{ matrix.test_task }} ${{ matrix.configure }}",
|
||||
"url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}",
|
||||
"commit": "${{ github.sha }}",
|
||||
"branch": "${{ github.ref_name }}"
|
||||
}
|
||||
env:
|
||||
label: ${{ matrix.test_task }} ${{ matrix.configure }}
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.SIMPLER_ALERTS_URL }} # ruby-lang slack: ruby/simpler-alerts-bot
|
||||
if: ${{ failure() && github.event_name == 'push' }}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user