kettle-jem 7.1.42 → 7.1.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +129 -7
- data/README.md +30 -3
- data/lib/kettle/jem/ci/harden_macos_ca_bundle.sh +75 -0
- data/lib/kettle/jem/maintenance_changelog.rb +1 -1
- data/lib/kettle/jem/tasks/install_task.rb +98 -5
- data/lib/kettle/jem/templates/.duel.rb.example +10 -0
- data/lib/kettle/jem/templates/.git-hooks/commit-msg.example +6 -6
- data/lib/kettle/jem/templates/.git-hooks/commit-subjects-goalie.txt.example +7 -1
- data/lib/kettle/jem/templates/.github/workflows/coverage.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/current.yml.example +2 -2
- data/lib/kettle/jem/templates/.github/workflows/dep-heads.yml.example +3 -3
- data/lib/kettle/jem/templates/.github/workflows/dependency-review.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/discord-notifier.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/framework-ci.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/heads.yml.example +2 -2
- data/lib/kettle/jem/templates/.github/workflows/jruby-10.0.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/jruby-9.1.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/jruby-9.2.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/jruby-9.3.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/jruby-9.4.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/jruby.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/locked_deps.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/opencollective.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/perf-comment.yml.example +92 -0
- data/lib/kettle/jem/templates/.github/workflows/perf.yml.example +152 -69
- data/lib/kettle/jem/templates/.github/workflows/ruby-2.3.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-2.4.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-2.5.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-2.6.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-2.7.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-3.0.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-3.1.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-3.2.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-3.3.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/ruby-3.4.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/style.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/templating.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/truffle.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/truffleruby-22.3.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/truffleruby-23.1.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/truffleruby-24.2.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/truffleruby-25.0.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/truffleruby-33.0.yml.example +1 -1
- data/lib/kettle/jem/templates/.github/workflows/unlocked_deps.yml.example +1 -1
- data/lib/kettle/jem/templates/.structuredmerge/kettle-jem.yml.example +2 -2
- data/lib/kettle/jem/templates/Appraisals.example +12 -0
- data/lib/kettle/jem/templates/CONTRIBUTING.md.example +5 -1
- data/lib/kettle/jem/templates/Gemfile.example +3 -1
- data/lib/kettle/jem/templates/gem.gemspec.example +10 -6
- data/lib/kettle/jem/templates/gemfiles/modular/coverage.gemfile.example +1 -1
- data/lib/kettle/jem/templates/gemfiles/modular/debug.gemfile.example +1 -1
- data/lib/kettle/jem/templates/gemfiles/modular/documentation.gemfile.example +5 -5
- data/lib/kettle/jem/templates/gemfiles/modular/duel.gemfile.example +1 -1
- data/lib/kettle/jem/templates/gemfiles/modular/optional.gemfile.example +1 -1
- data/lib/kettle/jem/templates/gemfiles/modular/ostruct/r4/v0.6.gemfile.example +1 -1
- data/lib/kettle/jem/templates/gemfiles/modular/rspec.gemfile.example +12 -4
- data/lib/kettle/jem/templates/gemfiles/modular/rspec_junit_formatter/r2/v0.6.gemfile.example +7 -0
- data/lib/kettle/jem/templates/gemfiles/modular/rspec_junit_formatter/r3/v0.8.gemfile.example +2 -0
- data/lib/kettle/jem/templates/gemfiles/modular/rspec_junit_formatter/r3.2/v0.6.gemfile.example +7 -0
- data/lib/kettle/jem/templates/gemfiles/modular/rspec_junit_formatter/r4/v0.8.gemfile.example +2 -0
- data/lib/kettle/jem/templates/gemfiles/modular/style_local.gemfile.example +1 -1
- data/lib/kettle/jem/templates/gemfiles/modular/templating.gemfile.example +2 -1
- data/lib/kettle/jem/templates/gemfiles/modular/templating_local.gemfile.example +34 -18
- data/lib/kettle/jem/templates/gemfiles/modular/x_std_libs.gemfile.example +10 -2
- data/lib/kettle/jem/templates/readme/partials/configuration.md.example +3 -0
- data/lib/kettle/jem/templates/shim/Gemfile.example +1 -1
- data/lib/kettle/jem/templates/shim/gem.gemspec.example +3 -3
- data/lib/kettle/jem/version.rb +1 -1
- data/lib/kettle/jem.rb +729 -104
- data.tar.gz.sig +0 -0
- metadata +1187 -1037
- metadata.gz.sig +0 -0
- data/lib/kettle/jem/templates/.idea/.gitignore.example +0 -44
|
@@ -31,7 +31,7 @@ jobs:
|
|
|
31
31
|
# Steps represent a sequence of tasks that will be executed as part of the job
|
|
32
32
|
steps:
|
|
33
33
|
- name: Actions Status Discord
|
|
34
|
-
uses: sarisia/actions-status-discord@
|
|
34
|
+
uses: sarisia/actions-status-discord@74e2ad0c4e57ca8b9ba6aee75d5a7841497bbb87 # v1.16.1
|
|
35
35
|
if: always()
|
|
36
36
|
with:
|
|
37
37
|
webhook: ${{ secrets.DISCORD_WEBHOOK }}
|
|
@@ -61,7 +61,7 @@ jobs:
|
|
|
61
61
|
persist-credentials: false
|
|
62
62
|
|
|
63
63
|
- name: Setup Ruby & RubyGems
|
|
64
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
64
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
65
65
|
with:
|
|
66
66
|
ruby-version: "${{ matrix.ruby }}"
|
|
67
67
|
rubygems: "${{ matrix.rubygems }}"
|
|
@@ -57,7 +57,7 @@ jobs:
|
|
|
57
57
|
|
|
58
58
|
- name: Setup Ruby & RubyGems
|
|
59
59
|
if: ${{ !env.ACT }}
|
|
60
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
60
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
61
61
|
with:
|
|
62
62
|
ruby-version: ${{ matrix.ruby }}
|
|
63
63
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -123,7 +123,7 @@ jobs:
|
|
|
123
123
|
|
|
124
124
|
- name: Setup Ruby & RubyGems
|
|
125
125
|
if: ${{ !env.ACT }}
|
|
126
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
126
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
127
127
|
with:
|
|
128
128
|
ruby-version: ${{ matrix.ruby }}
|
|
129
129
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -63,7 +63,7 @@ jobs:
|
|
|
63
63
|
|
|
64
64
|
- name: Setup Ruby & RubyGems
|
|
65
65
|
if: ${{ !env.ACT }}
|
|
66
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
66
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
67
67
|
with:
|
|
68
68
|
ruby-version: ${{ matrix.ruby }}
|
|
69
69
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -62,7 +62,7 @@ jobs:
|
|
|
62
62
|
|
|
63
63
|
- name: Setup Ruby & RubyGems
|
|
64
64
|
if: ${{ !env.ACT }}
|
|
65
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
65
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
66
66
|
with:
|
|
67
67
|
ruby-version: ${{ matrix.ruby }}
|
|
68
68
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -62,7 +62,7 @@ jobs:
|
|
|
62
62
|
|
|
63
63
|
- name: Setup Ruby & RubyGems
|
|
64
64
|
if: ${{ !env.ACT }}
|
|
65
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
65
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
66
66
|
with:
|
|
67
67
|
ruby-version: ${{ matrix.ruby }}
|
|
68
68
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -62,7 +62,7 @@ jobs:
|
|
|
62
62
|
|
|
63
63
|
- name: Setup Ruby & RubyGems
|
|
64
64
|
if: ${{ !env.ACT }}
|
|
65
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
65
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
66
66
|
with:
|
|
67
67
|
ruby-version: ${{ matrix.ruby }}
|
|
68
68
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -62,7 +62,7 @@ jobs:
|
|
|
62
62
|
|
|
63
63
|
- name: Setup Ruby & RubyGems
|
|
64
64
|
if: ${{ !env.ACT }}
|
|
65
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
65
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
66
66
|
with:
|
|
67
67
|
ruby-version: ${{ matrix.ruby }}
|
|
68
68
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -63,7 +63,7 @@ jobs:
|
|
|
63
63
|
|
|
64
64
|
- name: Setup Ruby & RubyGems
|
|
65
65
|
if: ${{ !env.ACT }}
|
|
66
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
66
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
67
67
|
with:
|
|
68
68
|
ruby-version: ${{ matrix.ruby }}
|
|
69
69
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -77,7 +77,7 @@ jobs:
|
|
|
77
77
|
persist-credentials: false
|
|
78
78
|
|
|
79
79
|
- name: Setup Ruby & RubyGems
|
|
80
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
80
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
81
81
|
with:
|
|
82
82
|
ruby-version: ${{ matrix.ruby }}
|
|
83
83
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -20,7 +20,7 @@ jobs:
|
|
|
20
20
|
with:
|
|
21
21
|
persist-credentials: false
|
|
22
22
|
- name: Setup Ruby & RubyGems
|
|
23
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
23
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
24
24
|
with:
|
|
25
25
|
ruby-version: ruby
|
|
26
26
|
rubygems: default
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
name: Perf comment
|
|
2
|
+
|
|
3
|
+
# Duel's report, as a new comment on the pull request, when Duel says to:
|
|
4
|
+
# always (post), or only when its last comment's status differs from the
|
|
5
|
+
# run's (change), so the latest comment is never stale. It never edits or
|
|
6
|
+
# deletes a comment, but hides Duel's earlier ones as outdated, so the
|
|
7
|
+
# newest is the one in view. It runs once the Perf workflow has, with
|
|
8
|
+
# this repository's own workflow and a token that can write, so a pull
|
|
9
|
+
# request from a fork gets a comment too. It checks nothing out and runs
|
|
10
|
+
# none of the pull request's code, only `duel comment` (see Duel's
|
|
11
|
+
# docs/ci.md), which trusts only what the Duel job could have said in
|
|
12
|
+
# what it kept: the pull request's number, if it names the pull request
|
|
13
|
+
# the run compared, and the comment and the status, if they're ones Duel
|
|
14
|
+
# says. Its report, a fork's too, is the comment, as Markdown.
|
|
15
|
+
#
|
|
16
|
+
# And when the label that accepts a regression (c.accept_label in
|
|
17
|
+
# .duel.rb) is added to a pull request, or taken off, it runs the Duel
|
|
18
|
+
# job again, which reads the labels as it runs: a run that failed, once
|
|
19
|
+
# the label's added, or one that passed, once it's taken off.
|
|
20
|
+
#
|
|
21
|
+
# (The workflow must be on the default branch before it runs at all.)
|
|
22
|
+
on:
|
|
23
|
+
workflow_run:
|
|
24
|
+
workflows: ["Perf"]
|
|
25
|
+
types: [completed]
|
|
26
|
+
# (This repository's own workflow, as for the comment, with a token
|
|
27
|
+
# that can run a workflow again: it checks nothing out, and runs none
|
|
28
|
+
# of the pull request's code.)
|
|
29
|
+
pull_request_target:
|
|
30
|
+
types: [labeled, unlabeled]
|
|
31
|
+
|
|
32
|
+
permissions: {}
|
|
33
|
+
|
|
34
|
+
jobs:
|
|
35
|
+
comment:
|
|
36
|
+
name: Comment
|
|
37
|
+
if: ${{ github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion != 'cancelled' }}
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
permissions:
|
|
40
|
+
actions: read # to get the report from the Perf run
|
|
41
|
+
pull-requests: write # to comment on the pull request with the report
|
|
42
|
+
steps:
|
|
43
|
+
- name: Get the report
|
|
44
|
+
id: report
|
|
45
|
+
continue-on-error: true # there's none when the Duel job failed before comparing
|
|
46
|
+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
47
|
+
with:
|
|
48
|
+
name: duel-report
|
|
49
|
+
path: ${{ runner.temp }}/report
|
|
50
|
+
run-id: ${{ github.event.workflow_run.id }}
|
|
51
|
+
github-token: ${{ github.token }}
|
|
52
|
+
- uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
|
|
53
|
+
if: steps.report.outcome == 'success'
|
|
54
|
+
with:
|
|
55
|
+
ruby-version: ruby
|
|
56
|
+
# Duel's own code, from RubyGems (none of the pull request's), so a
|
|
57
|
+
# fix to how it comments comes with a release of Duel.
|
|
58
|
+
- name: Comment on the pull request
|
|
59
|
+
if: steps.report.outcome == 'success'
|
|
60
|
+
env:
|
|
61
|
+
GH_TOKEN: ${{ github.token }}
|
|
62
|
+
HEAD_SHA: ${{ github.event.workflow_run.head_sha }}
|
|
63
|
+
run: |
|
|
64
|
+
gem install duel --version '~> 0.1.8' --no-document
|
|
65
|
+
duel comment --report "$RUNNER_TEMP/report" --head "$HEAD_SHA" --marker 'duel'
|
|
66
|
+
|
|
67
|
+
again:
|
|
68
|
+
name: Run Duel again
|
|
69
|
+
if: >-
|
|
70
|
+
github.event_name == 'pull_request_target' && github.event.label.name == 'duel: accept'
|
|
71
|
+
runs-on: ubuntu-latest
|
|
72
|
+
permissions:
|
|
73
|
+
actions: write # to run the Perf workflow's jobs again
|
|
74
|
+
steps:
|
|
75
|
+
- name: Run Duel again
|
|
76
|
+
env:
|
|
77
|
+
GH_TOKEN: ${{ github.token }}
|
|
78
|
+
GH_REPO: ${{ github.repository }}
|
|
79
|
+
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
80
|
+
ACTION: ${{ github.event.action }}
|
|
81
|
+
run: |
|
|
82
|
+
# The newest Perf run of the pull request's head commit, once it's
|
|
83
|
+
# done (one that's running may have read the labels already).
|
|
84
|
+
id=$(gh run list --workflow "Perf" --event pull_request --commit "$HEAD_SHA" --limit 1 \
|
|
85
|
+
--json databaseId --jq '.[0].databaseId // empty')
|
|
86
|
+
[ -n "$id" ] || exit 0
|
|
87
|
+
gh run watch "$id" --interval 30 > /dev/null || true
|
|
88
|
+
conclusion=$(gh run view "$id" --json conclusion --jq .conclusion)
|
|
89
|
+
case "$ACTION:$conclusion" in
|
|
90
|
+
labeled:failure) gh run rerun "$id" --failed ;;
|
|
91
|
+
unlabeled:success) gh run rerun "$id" ;;
|
|
92
|
+
esac
|
|
@@ -4,39 +4,43 @@ name: Perf
|
|
|
4
4
|
# baseline and on this code side by side, and fails if this code is slower.
|
|
5
5
|
# See .duel.rb and https://github.com/sferik/duel-ruby
|
|
6
6
|
|
|
7
|
-
# The Duel job runs this branch's code, so it only reads.
|
|
8
|
-
# job of its own, which runs none of it
|
|
7
|
+
# The Duel job runs this branch's code, so it only reads. Marking a push
|
|
8
|
+
# passed is a job of its own, which runs none of it, and commenting on a
|
|
9
|
+
# pull request is the Perf comment workflow's.
|
|
9
10
|
permissions:
|
|
10
11
|
contents: read
|
|
12
|
+
pull-requests: read # for the pull request's labels (see c.accept_label)
|
|
11
13
|
|
|
12
14
|
on:
|
|
13
15
|
pull_request:
|
|
16
|
+
merge_group: # (a merge queue's)
|
|
14
17
|
push:
|
|
15
18
|
branches:
|
|
16
|
-
- 'main'
|
|
19
|
+
- 'main' # (and any other branch to guard, a stable one, say)
|
|
17
20
|
schedule:
|
|
18
21
|
- cron: "0 4 * * *"
|
|
19
22
|
# Allow manually triggering the workflow.
|
|
20
23
|
workflow_dispatch:
|
|
21
24
|
|
|
22
|
-
#
|
|
23
|
-
#
|
|
24
|
-
#
|
|
25
|
-
# that comparison.
|
|
25
|
+
# A pull request's newer push cancels its run, if that's still going, as
|
|
26
|
+
# only its newest commit's result counts. Every other run (a push's, say)
|
|
27
|
+
# runs to the end, so that each push is compared.
|
|
26
28
|
concurrency:
|
|
27
|
-
group:
|
|
28
|
-
cancel-in-progress:
|
|
29
|
+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.pull_request.number || github.run_id }}
|
|
30
|
+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
|
29
31
|
|
|
30
32
|
jobs:
|
|
31
33
|
duel:
|
|
32
34
|
if: "github.event_name != 'push' || (!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]'))"
|
|
33
35
|
name: Duel
|
|
34
36
|
runs-on: ubuntu-latest
|
|
35
|
-
# Whether
|
|
36
|
-
#
|
|
37
|
+
# Whether to comment (post, change or none), the run's status (passed,
|
|
38
|
+
# failed or neutral), and whether to mark a push passed (true, or
|
|
39
|
+
# nothing), from Duel.
|
|
37
40
|
outputs:
|
|
38
41
|
comment: ${{ steps.compare.outputs.comment }}
|
|
39
42
|
status: ${{ steps.compare.outputs.status }}
|
|
43
|
+
passed: ${{ steps.compare.outputs.passed }}
|
|
40
44
|
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
|
|
41
45
|
# The perf appraisal: the gemspec's dependencies and Duel (Ruby 3.4 or later)
|
|
42
46
|
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/perf.gemfile
|
|
@@ -47,25 +51,73 @@ jobs:
|
|
|
47
51
|
fetch-depth: 0 # the baseline comes from history, tags included
|
|
48
52
|
persist-credentials: false
|
|
49
53
|
|
|
54
|
+
# The labels of the pull request (or for a push, of the one that
|
|
55
|
+
# merged it), for c.accept_label in .duel.rb, as a JSON array. They're
|
|
56
|
+
# read as the job runs, and adding the label (or taking it off) runs
|
|
57
|
+
# the job again: see the Perf comment workflow.
|
|
58
|
+
# On a schedule, the last commit since the last release that merged a
|
|
59
|
+
# pull request with the label (ACCEPT_LABEL, as .duel.rb names it):
|
|
60
|
+
# what that slowed down was accepted, so it's compared with instead.
|
|
61
|
+
- name: Find the pull request's labels
|
|
62
|
+
id: labels
|
|
63
|
+
if: github.event_name == 'pull_request' || github.event_name == 'merge_group' || github.event_name == 'push' || github.event_name == 'schedule'
|
|
64
|
+
continue-on-error: true # (without them, nothing's accepted)
|
|
65
|
+
env:
|
|
66
|
+
GH_TOKEN: ${{ github.token }}
|
|
67
|
+
PR: ${{ github.event.pull_request.number }}
|
|
68
|
+
QUEUED: ${{ github.event.merge_group.head_ref }}
|
|
69
|
+
ACCEPT_LABEL: 'duel: accept'
|
|
70
|
+
RELEASE_TAGS: "v*"
|
|
71
|
+
run: |
|
|
72
|
+
if [ "$GITHUB_EVENT_NAME" = schedule ]; then
|
|
73
|
+
tag=$(git describe --tags --abbrev=0 --match "$RELEASE_TAGS" HEAD^ 2>/dev/null) || exit 0
|
|
74
|
+
since=$(TZ=UTC git log -1 --date=format-local:%Y-%m-%dT%H:%M:%SZ --format=%cd "$tag")
|
|
75
|
+
merged=$(gh pr list --repo "$GITHUB_REPOSITORY" --state merged --label "$ACCEPT_LABEL" --search "merged:>=$since" --limit 1000 \
|
|
76
|
+
--json mergeCommit --jq '.[].mergeCommit.oid')
|
|
77
|
+
accepted=$(git rev-list "$tag..HEAD" | grep -Fx -m 1 -f <(echo "$merged")) || accepted=
|
|
78
|
+
echo "accepted=$accepted" >> "$GITHUB_OUTPUT"
|
|
79
|
+
exit 0
|
|
80
|
+
fi
|
|
81
|
+
# (In a merge queue, the last pull request queued, which the queue's
|
|
82
|
+
# branch names: gh-readonly-queue/main/pr-123-<sha>.)
|
|
83
|
+
if [ -n "$QUEUED" ]; then
|
|
84
|
+
PR=${QUEUED##*/pr-}
|
|
85
|
+
PR=${PR%%-*}
|
|
86
|
+
fi
|
|
87
|
+
if [ -n "$PR" ]; then
|
|
88
|
+
labels=$(gh api "repos/$GITHUB_REPOSITORY/issues/$PR/labels" --jq '[.[].name]')
|
|
89
|
+
else
|
|
90
|
+
labels=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/pulls" --jq '[.[0].labels[]?.name]')
|
|
91
|
+
fi
|
|
92
|
+
echo "labels=$labels" >> "$GITHUB_OUTPUT"
|
|
93
|
+
|
|
50
94
|
# .duel.rb sets c.ruby = :version_file, so each version runs on the Ruby
|
|
51
95
|
# that its own version file names (.ruby-version, .tool-versions, or
|
|
52
96
|
# mise.toml, the first that names one, as Duel reads them). When the
|
|
53
97
|
# baseline's names another Ruby than this one's, install that Ruby too,
|
|
54
98
|
# and link it where Duel finds it. The baseline is the one the Compare
|
|
55
|
-
# step uses: the
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
99
|
+
# step uses: the branch it targets for a pull request, a merge queue's
|
|
100
|
+
# base, the commit before a push (or the last commit Duel passed, if
|
|
101
|
+
# there is one: see the Mark the commit passed job), the last release
|
|
102
|
+
# on a schedule (the newest v* tag before HEAD, as Duel finds it, or
|
|
103
|
+
# ACCEPTED, the last change accepted since then), and where HEAD left
|
|
104
|
+
# the default branch when run by hand.
|
|
59
105
|
- name: Find the baseline's Ruby
|
|
60
106
|
id: baseline
|
|
61
107
|
env:
|
|
62
108
|
BEFORE: ${{ github.event.before }}
|
|
109
|
+
QUEUE_BASE: ${{ github.event.merge_group.base_sha }}
|
|
110
|
+
PASSED: origin/duel/passed/${{ github.ref_name }}
|
|
63
111
|
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
|
|
112
|
+
ACCEPTED: ${{ steps.labels.outputs.accepted }}
|
|
64
113
|
run: |
|
|
65
114
|
case "$GITHUB_EVENT_NAME" in
|
|
66
115
|
pull_request) base="origin/$GITHUB_BASE_REF" ;;
|
|
67
|
-
push)
|
|
68
|
-
|
|
116
|
+
push)
|
|
117
|
+
base=$BEFORE
|
|
118
|
+
if git merge-base --is-ancestor "$PASSED" HEAD 2>/dev/null; then base=$PASSED; fi ;;
|
|
119
|
+
merge_group) base=$QUEUE_BASE ;;
|
|
120
|
+
schedule) base=${ACCEPTED:-$(git describe --tags --abbrev=0 --match 'v*' HEAD^ 2>/dev/null)} || base= ;;
|
|
69
121
|
*) base=$(git merge-base HEAD "origin/$DEFAULT_BRANCH" 2>/dev/null) || base= ;;
|
|
70
122
|
esac
|
|
71
123
|
ruby_of() {
|
|
@@ -92,7 +144,7 @@ jobs:
|
|
|
92
144
|
- name: Setup the baseline's Ruby
|
|
93
145
|
id: baseline-ruby
|
|
94
146
|
if: steps.baseline.outputs.ruby != ''
|
|
95
|
-
uses: ruby/setup-ruby@
|
|
147
|
+
uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
|
|
96
148
|
with:
|
|
97
149
|
ruby-version: ${{ steps.baseline.outputs.ruby }}
|
|
98
150
|
# The bundle for this Ruby too, which the baseline's workers load.
|
|
@@ -109,78 +161,109 @@ jobs:
|
|
|
109
161
|
|
|
110
162
|
# The candidate's Ruby, from its version file (the same one Duel reads)
|
|
111
163
|
- name: Setup Ruby & RubyGems
|
|
112
|
-
uses: ruby/setup-ruby@
|
|
164
|
+
uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
|
|
113
165
|
with:
|
|
114
166
|
bundler-cache: true
|
|
115
167
|
|
|
116
|
-
# Against the
|
|
117
|
-
# for a
|
|
118
|
-
#
|
|
119
|
-
#
|
|
120
|
-
#
|
|
168
|
+
# Against the branch it targets for a pull request, the queue's base
|
|
169
|
+
# for a merge queue, what was there before for a push (or as
|
|
170
|
+
# c.push_base in .duel.rb says, the last commit Duel passed), and the
|
|
171
|
+
# last release on a schedule (slow creep). Duel adds its report to
|
|
172
|
+
# the job's summary, writes it to duel.md for the comment, and sets
|
|
173
|
+
# the step's outputs to say whether to comment, as c.comment in
|
|
174
|
+
# .duel.rb says, whatever the outcome.
|
|
121
175
|
- name: Compare
|
|
122
176
|
id: compare
|
|
123
177
|
env:
|
|
124
|
-
DUEL_BASE: ${{ github.event_name == 'schedule' && 'last-release' || github.event_name == 'push' && github.event.before || '' }}
|
|
178
|
+
DUEL_BASE: ${{ github.event_name == 'schedule' && 'last-release' || github.event_name == 'push' && github.event.before || github.event_name == 'merge_group' && github.event.merge_group.base_sha || '' }}
|
|
125
179
|
# (Run by hand, it compares anyway: with nothing changed, the code
|
|
126
180
|
# with itself, which checks the setup.)
|
|
127
181
|
DUEL_FORCE: ${{ github.event_name == 'workflow_dispatch' && '1' || '' }}
|
|
182
|
+
DUEL_LABELS: ${{ steps.labels.outputs.labels }}
|
|
183
|
+
DUEL_ACCEPTED: ${{ steps.labels.outputs.accepted }}
|
|
184
|
+
run: bundle exec duel --markdown "$RUNNER_TEMP/duel/duel.md"
|
|
185
|
+
|
|
186
|
+
# For a pull request, what Duel said, for the Perf comment workflow,
|
|
187
|
+
# which can't see this job's outputs.
|
|
188
|
+
- name: Say whether to comment
|
|
189
|
+
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
|
|
190
|
+
env:
|
|
191
|
+
PR: ${{ github.event.pull_request.number }}
|
|
192
|
+
COMMENT: ${{ steps.compare.outputs.comment }}
|
|
193
|
+
STATUS: ${{ steps.compare.outputs.status }}
|
|
128
194
|
run: |
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
if [ "$GITHUB_EVENT_NAME" = push ] && ! git cat-file -e "$DUEL_BASE^{commit}" 2>/dev/null; then
|
|
132
|
-
echo "::notice::No commit before this push to compare against"
|
|
133
|
-
exit 0
|
|
134
|
-
fi
|
|
135
|
-
bundle exec duel --markdown "$RUNNER_TEMP/duel.md"
|
|
195
|
+
mkdir -p "$RUNNER_TEMP/duel"
|
|
196
|
+
printf 'pr=%s\ncomment=%s\nstatus=%s\n' "$PR" "$COMMENT" "$STATUS" > "$RUNNER_TEMP/duel/comment.env"
|
|
136
197
|
|
|
137
|
-
# The report, for the
|
|
198
|
+
# The report, for the comments
|
|
138
199
|
- name: Keep the report
|
|
139
|
-
if: ${{ !cancelled() && github.event_name == 'pull_request' }}
|
|
200
|
+
if: ${{ !cancelled() && (github.event_name == 'pull_request' || github.event_name == 'push') }}
|
|
140
201
|
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
|
|
141
202
|
with:
|
|
142
203
|
name: duel-report
|
|
143
|
-
path: ${{ runner.temp }}/duel
|
|
144
|
-
if-no-files-found: ignore # none when
|
|
204
|
+
path: ${{ runner.temp }}/duel/
|
|
205
|
+
if-no-files-found: ignore # none when Duel didn't get to compare
|
|
145
206
|
retention-days: 1
|
|
146
207
|
|
|
147
|
-
#
|
|
148
|
-
#
|
|
149
|
-
#
|
|
150
|
-
#
|
|
151
|
-
#
|
|
152
|
-
#
|
|
153
|
-
#
|
|
154
|
-
|
|
155
|
-
|
|
208
|
+
# With c.push_base = :last_passed in .duel.rb, a push is compared with
|
|
209
|
+
# the last commit Duel passed, which a branch marks (each branch pushed
|
|
210
|
+
# has its own), so slowdowns too small for any one push to fail add up
|
|
211
|
+
# until they fail one. This job moves the branch to a push that passed
|
|
212
|
+
# (or makes it), but never back: where a newer push's run moved it
|
|
213
|
+
# first, it stays. It checks nothing out and runs none of the code. To
|
|
214
|
+
# accept a regression, move the branch yourself (for main, git push
|
|
215
|
+
# origin main:duel/passed/main).
|
|
216
|
+
passed:
|
|
217
|
+
name: Mark the commit passed
|
|
156
218
|
needs: duel
|
|
157
|
-
|
|
219
|
+
# One at a time for each branch, so that two runs can't both find no
|
|
220
|
+
# branch and race to make it (a push's run doesn't wait for the one
|
|
221
|
+
# before it). One that's running is never cancelled, and one that's
|
|
222
|
+
# waiting gives way to a newer push's, which moves it further anyway.
|
|
223
|
+
concurrency:
|
|
224
|
+
group: ${{ github.workflow }}-passed-${{ github.ref_name }}
|
|
225
|
+
cancel-in-progress: false
|
|
226
|
+
if: ${{ !cancelled() && github.event_name == 'push' && needs.duel.outputs.passed == 'true' }}
|
|
158
227
|
runs-on: ubuntu-latest
|
|
159
228
|
permissions:
|
|
160
|
-
|
|
229
|
+
contents: write # to move the branch
|
|
161
230
|
steps:
|
|
162
|
-
- name:
|
|
163
|
-
id: report
|
|
164
|
-
continue-on-error: true # the Duel job keeps no report when it fails before comparing
|
|
165
|
-
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
|
|
166
|
-
with:
|
|
167
|
-
name: duel-report
|
|
168
|
-
path: ${{ runner.temp }}/report
|
|
169
|
-
|
|
170
|
-
- name: Comment on the pull request
|
|
171
|
-
if: steps.report.outcome == 'success'
|
|
231
|
+
- name: Move the branch to the commit
|
|
172
232
|
env:
|
|
173
233
|
GH_TOKEN: ${{ github.token }}
|
|
174
|
-
|
|
175
|
-
COMMENT: ${{ needs.duel.outputs.comment }}
|
|
176
|
-
STATUS: ${{ needs.duel.outputs.status }}
|
|
234
|
+
BRANCH: duel/passed/${{ github.ref_name }}
|
|
177
235
|
run: |
|
|
178
|
-
|
|
179
|
-
#
|
|
180
|
-
#
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
236
|
+
# (Git can't make a branch where another's name is a folder of its
|
|
237
|
+
# name: a branch named duel blocks duel/passed/main. If one does,
|
|
238
|
+
# this names it.)
|
|
239
|
+
blocked() {
|
|
240
|
+
prefix=$BRANCH
|
|
241
|
+
while [ "${prefix%/*}" != "$prefix" ]; do
|
|
242
|
+
prefix=${prefix%/*}
|
|
243
|
+
if gh api "repos/$GITHUB_REPOSITORY/git/ref/heads/$prefix" > /dev/null 2>&1; then
|
|
244
|
+
echo "::error::The branch $prefix keeps Duel from making $BRANCH, as Git can't have both. Delete it (git push origin --delete $prefix), or rename it."
|
|
245
|
+
fi
|
|
246
|
+
done
|
|
247
|
+
exit 1
|
|
248
|
+
}
|
|
249
|
+
# (Forward: GitHub moves it only where it's behind the push. Where
|
|
250
|
+
# there's no branch, and making it fails, it looks once more, as
|
|
251
|
+
# something else may have made it: a push of it, say.)
|
|
252
|
+
for _ in 1 2; do
|
|
253
|
+
gh api --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/heads/$BRANCH" -f sha="$GITHUB_SHA" > /dev/null 2>&1 && exit 0
|
|
254
|
+
at=$(gh api "repos/$GITHUB_REPOSITORY/git/ref/heads/$BRANCH" --jq .object.sha 2>/dev/null) || at=
|
|
255
|
+
[ -n "$at" ] && break
|
|
256
|
+
gh api --method POST "repos/$GITHUB_REPOSITORY/git/refs" -f ref="refs/heads/$BRANCH" -f sha="$GITHUB_SHA" > /dev/null && exit 0
|
|
257
|
+
done
|
|
258
|
+
[ -n "$at" ] || blocked
|
|
259
|
+
compared=$(gh api "repos/$GITHUB_REPOSITORY/compare/$GITHUB_SHA...$at" --jq .status 2>&1) || case "$compared" in
|
|
260
|
+
# (GitHub can't compare commits with no history in common.)
|
|
261
|
+
*"No common ancestor"*) compared=unrelated ;;
|
|
262
|
+
esac
|
|
263
|
+
case "$compared" in
|
|
264
|
+
# (A newer push's run moved it, or this one's did, run again.)
|
|
265
|
+
ahead | identical) ;;
|
|
266
|
+
# (History rewritten, a force push's, say, or replaced: moved anyway.)
|
|
267
|
+
diverged | behind | unrelated) gh api --method PATCH "repos/$GITHUB_REPOSITORY/git/refs/heads/$BRANCH" -f sha="$GITHUB_SHA" -F force=true > /dev/null ;;
|
|
268
|
+
*) echo "::error::Couldn't compare $BRANCH with this push: $compared" && exit 1 ;;
|
|
269
|
+
esac
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
persist-credentials: false
|
|
54
54
|
|
|
55
55
|
- name: Setup Ruby & RubyGems
|
|
56
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
56
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
57
57
|
with:
|
|
58
58
|
ruby-version: ${{ matrix.ruby }}
|
|
59
59
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -53,7 +53,7 @@ jobs:
|
|
|
53
53
|
persist-credentials: false
|
|
54
54
|
|
|
55
55
|
- name: Setup Ruby & RubyGems
|
|
56
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
56
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
57
57
|
with:
|
|
58
58
|
ruby-version: ${{ matrix.ruby }}
|
|
59
59
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|
|
@@ -50,7 +50,7 @@ jobs:
|
|
|
50
50
|
persist-credentials: false
|
|
51
51
|
|
|
52
52
|
- name: Setup Ruby & RubyGems
|
|
53
|
-
uses: appraisal-rb/setup-ruby-flash@
|
|
53
|
+
uses: appraisal-rb/setup-ruby-flash@b04c0c9f2e443c909968abc828a0b53e77567cf9 # v2.15 compatibility bundle installation
|
|
54
54
|
with:
|
|
55
55
|
ruby-version: ${{ matrix.ruby }}
|
|
56
56
|
rubygems: ${{ matrix.rubygems }}
|