Skip to content

Commit 7e96508

Browse files
committed
🎨 Template bootstrap by kettle-dev-setup v1.1.9
1 parent 50c9a66 commit 7e96508

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+728
-778
lines changed

.aiignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# An .aiignore file follows the same syntax as a .gitignore file.
2+
# .gitignore documentation: https://git-scm.com/docs/gitignore
3+
4+
# you can ignore files
5+
.DS_Store
6+
*.log
7+
*.tmp
8+
9+
# or folders
10+
.devcontainer/
11+
.qlty/
12+
.yardoc/
13+
dist/
14+
build/
15+
out/
16+
coverage/
17+
docs/
18+
pkg/
19+
results/

.env.local.example

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,17 @@ export AUTOGEN_FIXTURE_CLEANUP=false # autogenerated gem fixture cleanup after e
1111
export GIT_HOOK_FOOTER_APPEND=false
1212
export GIT_HOOK_FOOTER_APPEND_DEBUG=false
1313
export GIT_HOOK_FOOTER_SENTINEL="⚡️ A message from a fellow meat-based-AI ⚡️"
14-
export GITHUB_TOKEN=<your GH PAT, for the GHA console bin/rake ci:act - DO NOT EVER COMMIT IT>
14+
15+
# Tokens used by ci:act and CI helpers for reading workflow/pipeline status via APIs
16+
# GitHub (either GITHUB_TOKEN or GH_TOKEN will be used; fine-grained recommended)
17+
# - Scope/permissions: For fine-grained tokens, grant repository access (Read) and Actions: Read
18+
# - For classic tokens, public repos need no scopes; private repos typically require repo
19+
export GITHUB_TOKEN=<your GH token for GHA status; NEVER COMMIT>
20+
# Alternatively:
21+
# export GH_TOKEN=<your GH token>
22+
23+
# GitLab (either GITLAB_TOKEN or GL_TOKEN will be used)
24+
# - Scope: read_api is sufficient to read pipelines
25+
export GITLAB_TOKEN=<your GitLab token for pipeline status; NEVER COMMIT>
26+
# Alternatively:
27+
# export GL_TOKEN=<your GitLab token>

.git-hooks/prepare-commit-msg

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@ PROJECT_ROOT="$(CDPATH= cd -- "$(dirname -- "$0")"/.. && pwd)"
1111
# One of the things .envrc needs to do is add $PROJECT_ROOT/bin/ to the path.
1212
# You should have this line at the top of .envrc
1313
# PATH_add bin
14-
# NOTE: this project needs to also add exe as well,
15-
# but other libraries won't generally need to do that.
14+
# NOTE: If this project ships exe scripts it should also add that.
1615
if command -v direnv >/dev/null 2>&1; then
1716
exec direnv exec "$PROJECT_ROOT" "kettle-commit-msg" "$@"
1817
else

.github/workflows/current.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ jobs:
6565

6666
steps:
6767
- name: Checkout
68+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
6869
uses: actions/checkout@v5
6970

7071
- name: Setup Ruby & RubyGems
72+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
7173
uses: ruby/setup-ruby@v1
7274
with:
7375
ruby-version: ${{ matrix.ruby }}
@@ -79,8 +81,11 @@ jobs:
7981
# We need to do this first to get appraisal installed.
8082
# NOTE: This does not use the primary Gemfile at all.
8183
- name: Install Root Appraisal
84+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
8285
run: bundle
8386
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}
87+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
8488
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
8589
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
90+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
8691
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/dep-heads.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Targets the evergreen latest release of ruby, truffleruby, and jruby
2+
# and tests against the HEAD of runtime dependencies
3+
name: Runtime Deps @ HEAD
4+
5+
permissions:
6+
contents: read
7+
8+
env:
9+
K_SOUP_COV_DO: false
10+
11+
on:
12+
push:
13+
branches:
14+
- 'main'
15+
- '*-stable'
16+
tags:
17+
- '!*' # Do not execute on tags
18+
pull_request:
19+
branches:
20+
- '*'
21+
# Allow manually triggering the workflow.
22+
workflow_dispatch:
23+
24+
# Cancels all previous workflow runs for the same branch that have not yet completed.
25+
concurrency:
26+
# The concurrency group contains the workflow name and the branch name.
27+
group: "${{ github.workflow }}-${{ github.ref }}"
28+
cancel-in-progress: true
29+
30+
jobs:
31+
test:
32+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
33+
name: Specs ${{ matrix.ruby }}@${{ matrix.appraisal }}${{ matrix.name_extra || '' }}
34+
runs-on: ubuntu-latest
35+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
36+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
37+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
38+
strategy:
39+
fail-fast: true
40+
matrix:
41+
include:
42+
# Ruby 3.4
43+
- ruby: "ruby"
44+
appraisal: "dep-heads"
45+
exec_cmd: "rake test"
46+
gemfile: "Appraisal.root"
47+
rubygems: latest
48+
bundler: latest
49+
50+
# truffleruby-24.1
51+
# (according to documentation: targets Ruby 3.3 compatibility)
52+
# (according to runtime: targets Ruby 3.2 compatibility)
53+
- ruby: "truffleruby"
54+
appraisal: "dep-heads"
55+
exec_cmd: "rake test"
56+
gemfile: "Appraisal.root"
57+
rubygems: default
58+
bundler: default
59+
60+
# jruby-10.0 (targets Ruby 3.4 compatibility)
61+
- ruby: "jruby"
62+
appraisal: "dep-heads"
63+
exec_cmd: "rake test"
64+
gemfile: "Appraisal.root"
65+
rubygems: default
66+
bundler: default
67+
68+
steps:
69+
- name: Checkout
70+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
71+
uses: actions/checkout@v5
72+
73+
- name: Setup Ruby & RubyGems
74+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
75+
uses: ruby/setup-ruby@v1
76+
with:
77+
ruby-version: ${{ matrix.ruby }}
78+
rubygems: ${{ matrix.rubygems }}
79+
bundler: ${{ matrix.bundler }}
80+
bundler-cache: false
81+
82+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
83+
# We need to do this first to get appraisal installed.
84+
# NOTE: This does not use the primary Gemfile at all.
85+
- name: "Install Root Appraisal"
86+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
87+
run: bundle
88+
89+
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
90+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
91+
id: bundleAttempt1
92+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
93+
# Continue to the next step on failure
94+
continue-on-error: true
95+
96+
# Effectively an automatic retry of the previous step.
97+
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
98+
# If bundleAttempt1 failed, try again here; Otherwise skip.
99+
if: ${{ steps.bundleAttempt1.outcome == 'failure' && !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
100+
id: bundleAttempt2
101+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
102+
103+
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
104+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
105+
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/heads.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ jobs:
6464

6565
steps:
6666
- name: Checkout
67+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
6768
uses: actions/checkout@v5
6869

6970
- name: Setup Ruby & RubyGems
71+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
7072
uses: ruby/setup-ruby@v1
7173
with:
7274
ruby-version: ${{ matrix.ruby }}
@@ -78,20 +80,23 @@ jobs:
7880
# We need to do this first to get appraisal installed.
7981
# NOTE: This does not use the primary Gemfile at all.
8082
- name: "Install Root Appraisal"
83+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
8184
run: bundle
8285

8386
- name: "[Attempt 1] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
87+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
8488
id: bundleAttempt1
8589
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
8690
# Continue to the next step on failure
8791
continue-on-error: true
8892

8993
# Effectively an automatic retry of the previous step.
9094
- name: "[Attempt 2] Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal }}"
91-
id: bundleAttempt2
9295
# If bundleAttempt1 failed, try again here; Otherwise skip.
93-
if: steps.bundleAttempt1.outcome == 'failure'
96+
if: ${{ steps.bundleAttempt1.outcome == 'failure' && !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
97+
id: bundleAttempt2
9498
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
9599

96100
- name: Tests for ${{ matrix.ruby }}@${{ matrix.appraisal }} via ${{ matrix.exec_cmd }}
101+
if: ${{ !(env.ACT && startsWith(matrix.ruby, 'jruby')) }}
97102
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.github/workflows/jruby.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ jobs:
4646

4747
steps:
4848
- name: Checkout
49+
if: ${{ !env.ACT }}
4950
uses: actions/checkout@v5
5051

5152
- name: Setup Ruby & RubyGems
53+
if: ${{ !env.ACT }}
5254
uses: ruby/setup-ruby@v1
5355
with:
5456
ruby-version: ${{ matrix.ruby }}
@@ -60,8 +62,11 @@ jobs:
6062
# We need to do this first to get appraisal installed.
6163
# NOTE: This does not use the primary Gemfile at all.
6264
- name: Install Root Appraisal
65+
if: ${{ !env.ACT }}
6366
run: bundle
6467
- name: Appraisal for ${{ matrix.appraisal }}
68+
if: ${{ !env.ACT }}
6569
run: bundle exec appraisal ${{ matrix.appraisal }} bundle
6670
- name: Tests for ${{ matrix.ruby }} via ${{ matrix.exec_cmd }}
71+
if: ${{ !env.ACT }}
6772
run: bundle exec appraisal ${{ matrix.appraisal }} bundle exec ${{ matrix.exec_cmd }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Appraisal.*.gemfile.lock
1616
/coverage/
1717
/spec/reports/
1818
/results/
19+
.output.txt
1920

2021
# Documentation
2122
/.yardoc/

.gitlab-ci.yml

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,39 @@
1+
# You can override the included template(s) by including variable overrides
2+
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
3+
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
4+
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
5+
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
6+
# Note that environment variables can be set in several places
7+
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence
8+
#stages:
9+
# - test
10+
#sast:
11+
# stage: test
12+
#include:
13+
# - template: Security/SAST.gitlab-ci.yml
14+
115
default:
2-
image: ruby:3.2
16+
image: ruby
317

418
variables:
519
BUNDLE_INSTALL_FLAGS: "--quiet --jobs=$(nproc) --retry=3"
620
BUNDLE_FROZEN: "false" # No lockfile!
21+
BUNDLE_GEMFILE: Appraisal.root.gemfile
722
K_SOUP_COV_DEBUG: true
823
K_SOUP_COV_DO: true
924
K_SOUP_COV_HARD: true
1025
K_SOUP_COV_MIN_BRANCH: 100
1126
K_SOUP_COV_MIN_LINE: 100
1227
K_SOUP_COV_VERBOSE: true
13-
K_SOUP_COV_FORMATTERS: "html,xml,rcov,lcov,json,tty"
28+
K_SOUP_COV_FORMATTERS: "tty"
1429
K_SOUP_COV_MULTI_FORMATTERS: true
1530
K_SOUP_COV_COMMAND_NAME: "RSpec Coverage"
1631

1732
workflow:
1833
rules:
1934
# For merge requests, create a pipeline.
2035
- if: '$CI_MERGE_REQUEST_IID'
21-
# For default branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
36+
# For the ` main ` branch, create a pipeline (this includes on schedules, pushes, merges, etc.).
2237
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
2338
# For tags, create a pipeline.
2439
- if: '$CI_COMMIT_TAG'
@@ -27,10 +42,25 @@ workflow:
2742
image: ruby:${RUBY_VERSION}
2843
stage: test
2944
script:
30-
- gem update --silent --system
31-
- bundle config --local path vendor
45+
# || true so we don't fail here, because it'll probably work even if the gem update fails
46+
- gem update --silent --system > /dev/null 2>&1 || true
47+
- mkdir -p vendor/bundle
48+
- bundle config set path 'vendor/bundle'
49+
- chmod +t -R vendor/bundle
50+
- chmod o-w -R vendor/bundle
51+
# Setup appraisal2
3252
- bundle install
33-
- bundle exec rake
53+
# Bundle a specific appraisal
54+
- bundle exec appraisal unlocked_deps bundle install
55+
# Light smoke test
56+
- bundle exec appraisal unlocked_deps bin/rake --tasks
57+
# Run tests, skipping those that won't work in CI
58+
- >
59+
bundle exec appraisal unlocked_deps \
60+
bin/rspec spec \
61+
--tag \~ci_skip \
62+
--format progress \
63+
--format RspecJunitFormatter
3464
cache:
3565
key: ${CI_JOB_IMAGE}
3666
paths:
@@ -40,21 +70,35 @@ workflow:
4070
image: ruby:${RUBY_VERSION}
4171
stage: test
4272
script:
43-
# Because we support EOL Ruby still...
44-
- gem install rubygems-update -v ${RUBYGEMS_VERSION}
73+
# RUBYGEMS_VERSION because we support EOL Ruby still...
74+
# || true so we don't fail here, because it'll probably work even if the gem update fails
75+
- gem install rubygems-update -v ${RUBYGEMS_VERSION} || true
4576
# Actually updates both RubyGems and Bundler!
4677
- update_rubygems
47-
- bundle config --local path vendor
78+
- mkdir -p vendor/bundle
79+
- bundle config set path 'vendor/bundle'
80+
- chmod +t -R vendor/bundle
81+
- chmod o-w -R vendor/bundle
82+
# Setup appraisal2
4883
- bundle install
49-
- bundle exec rake test
84+
# Bundle a specific appraisal
85+
- bundle exec appraisal ${APPRAISAL} bundle install
86+
# Light smoke test
87+
- bundle exec appraisal ${APPRAISAL} bin/rake --tasks
88+
# Run tests, skipping those that won't work in CI
89+
- >
90+
bundle exec appraisal unlocked_deps \
91+
bin/rspec spec \
92+
--tag \~ci_skip \
93+
--format progress \
94+
--format RspecJunitFormatter
5095
cache:
5196
key: ${CI_JOB_IMAGE}
5297
paths:
5398
- vendor/ruby
5499

55100
ruby-current:
56101
variables:
57-
BUNDLE_GEMFILE: gemfiles/omnibus.gemfile
58102
K_SOUP_COV_DO: true
59103
<<: *test_definition-current
60104
parallel:
@@ -64,7 +108,7 @@ ruby-current:
64108
ruby-ruby3_1:
65109
variables:
66110
RUBYGEMS_VERSION: "3.6.9"
67-
BUNDLE_GEMFILE: gemfiles/vanilla.gemfile
111+
APPRAISAL: ruby_3_1
68112
K_SOUP_COV_DO: false
69113
<<: *test_definition-legacy
70114
parallel:
@@ -74,7 +118,7 @@ ruby-ruby3_1:
74118
ruby-ruby3_0:
75119
variables:
76120
RUBYGEMS_VERSION: "3.5.23"
77-
BUNDLE_GEMFILE: gemfiles/vanilla.gemfile
121+
APPRAISAL: ruby_3_0
78122
K_SOUP_COV_DO: false
79123
<<: *test_definition-legacy
80124
parallel:
@@ -84,7 +128,7 @@ ruby-ruby3_0:
84128
ruby-ruby2_7:
85129
variables:
86130
RUBYGEMS_VERSION: "3.4.22"
87-
BUNDLE_GEMFILE: gemfiles/vanilla.gemfile
131+
APPRAISAL: ruby_2_7
88132
K_SOUP_COV_DO: false
89133
<<: *test_definition-legacy
90134
parallel:

0 commit comments

Comments
 (0)