Skip to content

Commit cea571c

Browse files
committed
👷 deps locked & unlocked pattern
- rubygems/bundler-site#501
1 parent e260266 commit cea571c

29 files changed

+229
-45
lines changed

.github/workflows/deps_locked.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
# Lock/Unlock Deps Pattern
3+
#
4+
# Two often conflicting goals resolved!
5+
#
6+
# - deps_unlocked.yml
7+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
8+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
9+
# - Know when new dependency releases will break local dev with unlocked dependencies
10+
# - Broken workflow indicates that new releases of dependencies may not work
11+
#
12+
# - deps_locked.yml
13+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
14+
# - Uses the project's main Gemfile, and the current MRI Ruby release
15+
# - Matches what contributors and maintainers use locally for development
16+
# - Broken workflow indicates that a new contributor will have a bad time
17+
#
18+
name: Deps Locked
19+
20+
permissions:
21+
contents: read
22+
23+
env:
24+
KITCHEN_SINK: true
25+
26+
on:
27+
push:
28+
branches:
29+
- 'main'
30+
- '*-stable'
31+
tags:
32+
- '!*' # Do not execute on tags
33+
pull_request:
34+
branches:
35+
- '*'
36+
# Allow manually triggering the workflow.
37+
workflow_dispatch:
38+
39+
# Cancels all previous workflow runs for the same branch that have not yet completed.
40+
concurrency:
41+
# The concurrency group contains the workflow name and the branch name.
42+
group: "${{ github.workflow }}-${{ github.ref }}"
43+
cancel-in-progress: true
44+
45+
jobs:
46+
test:
47+
name: Default rake task w/ main Gemfile.lock ${{ matrix.name_extra || '' }}
48+
if: ${{ !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]') }}
49+
runs-on: ubuntu-latest
50+
continue-on-error: ${{ matrix.experimental }}
51+
strategy:
52+
fail-fast: false
53+
matrix:
54+
include:
55+
# Ruby <whichever version is current, e.g., 3.4 as of 2025-07-12>
56+
- ruby: "ruby"
57+
exec_cmd: "rake"
58+
rubygems: latest
59+
bundler: latest
60+
experimental: false
61+
62+
steps:
63+
- name: Checkout
64+
uses: actions/checkout@v4
65+
66+
- name: Setup Ruby & RubyGems
67+
uses: ruby/setup-ruby@v1
68+
with:
69+
ruby-version: ${{ matrix.ruby }}
70+
rubygems: ${{ matrix.rubygems }}
71+
bundler: ${{ matrix.bundler }}
72+
bundler-cache: true
73+
74+
- name: Checks the kitchen sink via ${{ matrix.exec_cmd }}
75+
run: bundle exec ${{ matrix.exec_cmd }}

.github/workflows/deps_unlocked.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
---
2+
# Lock/Unlock Deps Pattern
3+
#
4+
# Two often conflicting goals resolved!
5+
#
6+
# - deps_unlocked.yml
7+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
8+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
9+
# - Know when new dependency releases will break local dev with unlocked dependencies
10+
# - Broken workflow indicates that new releases of dependencies may not work
11+
#
12+
# - deps_locked.yml
13+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
14+
# - Uses the project's main Gemfile, and the current MRI Ruby release
15+
# - Matches what contributors and maintainers use locally for development
16+
# - Broken workflow indicates that a new contributor will have a bad time
17+
#
18+
name: Deps Unlocked
19+
20+
permissions:
21+
contents: read
22+
23+
env:
24+
K_SOUP_COV_DO: false
25+
26+
on:
27+
push:
28+
branches:
29+
- 'main'
30+
- "*-stable"
31+
tags:
32+
- '!*' # Do not execute on tags
33+
pull_request:
34+
branches:
35+
- '*'
36+
# Allow manually triggering the workflow.
37+
workflow_dispatch:
38+
39+
# Cancels all previous workflow runs for the same branch that have not yet completed.
40+
concurrency:
41+
# The concurrency group contains the workflow name and the branch name.
42+
group: "${{ github.workflow }}-${{ github.ref }}"
43+
cancel-in-progress: true
44+
45+
jobs:
46+
test:
47+
name: Default rake task w/ unlocked deps ${{ matrix.name_extra || '' }}
48+
if: "!contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]')"
49+
runs-on: ubuntu-latest
50+
continue-on-error: ${{ matrix.experimental || endsWith(matrix.ruby, 'head') }}
51+
env: # $BUNDLE_GEMFILE must be set at job level, so it is set for all steps
52+
BUNDLE_GEMFILE: ${{ github.workspace }}/${{ matrix.gemfile }}.gemfile
53+
strategy:
54+
matrix:
55+
include:
56+
# Ruby <whichever version is current, e.g., 3.4 as of 2025-07-12>
57+
- ruby: "ruby"
58+
appraisal_name: "deps_unlocked"
59+
exec_cmd: "rake"
60+
gemfile: "Appraisal.root"
61+
rubygems: latest
62+
bundler: latest
63+
64+
steps:
65+
- name: Checkout
66+
uses: actions/checkout@v4
67+
68+
- name: Setup Ruby & RubyGems
69+
uses: ruby/setup-ruby@v1
70+
with:
71+
ruby-version: ${{ matrix.ruby }}
72+
rubygems: ${{ matrix.rubygems }}
73+
bundler: ${{ matrix.bundler }}
74+
bundler-cache: false
75+
76+
# Raw `bundle` will use the BUNDLE_GEMFILE set to matrix.gemfile (i.e. Appraisal.root)
77+
# We need to do this first to get appraisal installed.
78+
# NOTE: This does not use the main Gemfile at all.
79+
- name: Install Root Appraisal
80+
run: bundle
81+
- name: Appraisal for ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
82+
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle
83+
- name: Run ${{ matrix.exec_cmd }} on ${{ matrix.ruby }}@${{ matrix.appraisal_name }}
84+
run: bundle exec appraisal ${{ matrix.appraisal_name }} bundle exec ${{ matrix.exec_cmd }}

.idea/oauth2.iml

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Appraisals

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@
44
# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle
55
# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
66

7+
# Lock/Unlock Deps Pattern
8+
#
9+
# Two often conflicting goals resolved!
10+
#
11+
# - deps_unlocked.yml
12+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
13+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
14+
# - Know when new dependency releases will break local dev with unlocked dependencies
15+
# - Broken workflow indicates that new releases of dependencies may not work
16+
#
17+
# - deps_locked.yml
18+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
19+
# - Uses the project's main Gemfile, and the current MRI Ruby release
20+
# - Matches what contributors and maintainers use locally for development
21+
# - Broken workflow indicates that a new contributor will have a bad time
22+
#
23+
appraise "deps_unlocked" do
24+
eval_gemfile "modular/audit.gemfile"
25+
eval_gemfile "modular/coverage.gemfile"
26+
eval_gemfile "modular/documentation.gemfile"
27+
eval_gemfile "modular/style.gemfile"
28+
end
29+
730
# Used for HEAD (nightly) releases of ruby, truffleruby, and jruby.
831
# Split into discrete appraisals if one of them needs a dependency locked discretely.
932
appraise "head" do
@@ -22,14 +45,7 @@ end
2245
# Used for current releases of ruby, truffleruby, and jruby.
2346
# Split into discrete appraisals if one of them needs a dependency locked discretely.
2447
appraise "current" do
25-
gem "mutex_m", ">= 0.2"
26-
gem "stringio", ">= 3.0"
27-
eval_gemfile "modular/faraday_v2.gemfile"
28-
eval_gemfile "modular/hashie_v5.gemfile"
29-
eval_gemfile "modular/jwt_v3.gemfile"
30-
eval_gemfile "modular/logger_v1_7.gemfile"
31-
eval_gemfile "modular/multi_xml_v0_7.gemfile"
32-
eval_gemfile "modular/rack_v3.gemfile"
48+
eval_gemfile "modular/latest.gemfile"
3349
end
3450

3551
appraise "ruby-2-3-hashie_v0" do

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ Also, where reasonable, tested against the runtime dependencies of those depende
105105

106106
[sv-pub-api]: #-is-platform-support-part-of-the-public-api
107107

108-
\* MIT license; The only guarantees I make are for enterprise support.
108+
\* MIT license; The only guarantees I make are for [enterprise support](#enterprise-support).
109109

110110
<details>
111111
<summary>Standard Library Dependencies</summary>

gemfiles/audit.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source "https://rubygems.org"
55
gem "mutex_m", "~> 0.2"
66
gem "stringio", "~> 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

1010
eval_gemfile("modular/audit.gemfile")
1111

gemfiles/coverage.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ source "https://rubygems.org"
55
gem "mutex_m", "~> 0.2"
66
gem "stringio", "~> 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

1010
eval_gemfile("modular/coverage.gemfile")
1111

gemfiles/current.gemfile

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,6 @@
22

33
source "https://rubygems.org"
44

5-
gem "mutex_m", ">= 0.2"
6-
gem "stringio", ">= 3.0"
5+
gemspec :path => "../"
76

8-
gemspec path: "../"
9-
10-
eval_gemfile("modular/faraday_v2.gemfile")
11-
12-
eval_gemfile("modular/hashie_v5.gemfile")
13-
14-
eval_gemfile("modular/jwt_v3.gemfile")
15-
16-
eval_gemfile("modular/logger_v1_7.gemfile")
17-
18-
eval_gemfile("modular/multi_xml_v0_7.gemfile")
19-
20-
eval_gemfile("modular/rack_v3.gemfile")
7+
eval_gemfile("modular/latest.gemfile")

gemfiles/current_runtime_heads.gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ source "https://rubygems.org"
55
gem "mutex_m", ">= 0.2"
66
gem "stringio", ">= 3.0"
77

8-
gemspec path: "../"
8+
gemspec :path => "../"
99

1010
eval_gemfile("modular/runtime_heads.gemfile")

gemfiles/deps_unlocked.gemfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This file was generated by Appraisal2
2+
3+
source "https://rubygems.org"
4+
5+
gemspec :path => "../"
6+
7+
eval_gemfile("modular/audit.gemfile")
8+
9+
eval_gemfile("modular/coverage.gemfile")
10+
11+
eval_gemfile("modular/documentation.gemfile")
12+
13+
eval_gemfile("modular/style.gemfile")

0 commit comments

Comments
 (0)