Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 259197b

Browse files
authored
Merge pull request #157 from omniauth/simplify-ci
๐Ÿ‘ท Lock/Unlock Deps Pattern
2 parents b317cc0 + dbdf929 commit 259197b

Some content is hidden

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

45 files changed

+264
-54
lines changed

โ€Ž.github/workflows/current.ymlโ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ jobs:
3838
matrix:
3939
include:
4040
# Ruby 3.4
41-
- ruby: "3.4"
41+
- ruby: "ruby"
4242
appraisal_name: "ar-7-2"
4343
exec_cmd: "rake spec:orm:active_record"
4444
gemfile: "Appraisal.root"
4545
rubygems: latest
4646
bundler: latest
47-
- ruby: "3.4"
47+
- ruby: "ruby"
4848
appraisal_name: "ar-8-0"
4949
exec_cmd: "rake spec:orm:active_record"
5050
gemfile: "Appraisal.root"
5151
rubygems: latest
5252
bundler: latest
53-
- ruby: "3.4"
53+
- ruby: "ruby"
5454
appraisal_name: "sequel-5.86-r3"
5555
exec_cmd: "rake spec:orm:sequel"
5656
gemfile: "Appraisal.root"

โ€Ž.github/workflows/kitchen.ymlโ€Ž renamed to โ€Ž.github/workflows/deps_locked.ymlโ€Ž

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
11
---
2-
# Targets the Rakefile's default task and the main Gemfile,
3-
# which contributors and maintainers would use locally for development
4-
name: Kitchen Sink
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
519

620
permissions:
721
contents: read
@@ -30,7 +44,7 @@ concurrency:
3044

3145
jobs:
3246
test:
33-
name: Tests default rake task with main Gemfile.lock ${{ matrix.name_extra || '' }}
47+
name: Default rake task w/ main Gemfile.lock ${{ matrix.name_extra || '' }}
3448
if: ${{ !contains(github.event.commits[0].message, '[ci skip]') && !contains(github.event.commits[0].message, '[skip ci]') }}
3549
runs-on: ubuntu-latest
3650
continue-on-error: ${{ matrix.experimental }}
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/omniauth-identity.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.

โ€Ž.idea/vcs.xmlโ€Ž

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

โ€Ž.rubocop_gradual.lockโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"README.md:2730514579": [
2+
"README.md:3239175719": [
33
[201, 3, 100, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3592044714]
44
],
55
"Rakefile:3407355619": [

โ€ŽAppraisalsโ€Ž

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,31 @@
44
# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle
55
# BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
66
# bundle exec rake rubocop_gradual:autocorrect
7+
# NOTE: Commands need to be run from the devcontainer if old Rails or old sqlite3 won't install for you locally.
8+
9+
# Lock/Unlock Deps Pattern
10+
#
11+
# Two often conflicting goals resolved!
12+
#
13+
# - deps_unlocked.yml
14+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
15+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
16+
# - Know when new dependency releases will break local dev with unlocked dependencies
17+
# - Broken workflow indicates that new releases of dependencies may not work
18+
#
19+
# - deps_locked.yml
20+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
21+
# - Uses the project's main Gemfile, and the current MRI Ruby release
22+
# - Matches what contributors and maintainers use locally for development
23+
# - Broken workflow indicates that a new contributor will have a bad time
24+
#
25+
appraise "deps_unlocked" do
26+
eval_gemfile("modular/audit.gemfile")
27+
eval_gemfile("modular/coverage.gemfile")
28+
eval_gemfile("modular/documentation.gemfile")
29+
eval_gemfile("modular/style.gemfile")
30+
eval_gemfile("modular/x_std_libs.gemfile")
31+
end
732

833
# Used for HEAD (nightly) releases of ruby, truffleruby, and jruby.
934
# Split into discrete appraisals if one of them needs a dependency locked discretely.

โ€ŽCONTRIBUTING.mdโ€Ž

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,37 @@ BUNDLE_GEMFILE=Appraisal.root.gemfile bundle exec appraisal update
3434
bundle exec rake rubocop_gradual:autocorrect
3535
```
3636

37+
NOTE: Commands need to be run from the devcontainer if old Rails or old sqlite3 won't install for you locally.
38+
3739
When adding an appraisal to CI, check the [runner tool cache][๐Ÿƒโ€โ™‚๏ธrunner-tool-cache] to see which runner to use.
3840

41+
### We commit, and don't commit, our "gemfile.lock" files
42+
43+
Thanks to [Appraisal2](https://github.com/appraisal-rb/appraisal2) we have a `gemfiles/*.gemfile` suite
44+
in addition to the main `Gemfile` at the root of the project.
45+
We run a workflow against the main Gemfile, which has a `Gemfile.lock` committed, and
46+
we also run workflows against each of the Appraisal2 `gemfiles/*.gemfile` suite,
47+
which **do not** have `gemfiles/*.gemfile.lock` committed.
48+
49+
```
50+
# Lock/Unlock Deps Pattern
51+
#
52+
# Two often conflicting goals resolved!
53+
#
54+
# - deps_unlocked.yml
55+
# - All runtime & dev dependencies, but does not have a `gemfiles/*.gemfile.lock` committed
56+
# - Uses an Appraisal2 "deps_unlocked" gemfile, and the current MRI Ruby release
57+
# - Know when new dependency releases will break local dev with unlocked dependencies
58+
# - Broken workflow indicates that new releases of dependencies may not work
59+
#
60+
# - deps_locked.yml
61+
# - All runtime & dev dependencies, and has a `Gemfile.lock` committed
62+
# - Uses the project's main Gemfile, and the current MRI Ruby release
63+
# - Matches what contributors and maintainers use locally for development
64+
# - Broken workflow indicates that a new contributor will have a bad time
65+
#
66+
```
67+
3968
## The Reek List
4069

4170
Take a look at the `reek` list which is the file called `REEK` and find something to improve.

โ€ŽGemfileโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
1111
gemspec
1212

1313
### Std Lib Extracted Gems
14-
eval_gemfile "gemfiles/modular/x_std_libs/r3/libs.gemfile"
14+
eval_gemfile "gemfiles/modular/x_std_libs.gemfile"
1515

1616
### Security Audit
1717
eval_gemfile "gemfiles/modular/audit.gemfile"

โ€ŽREADME.mdโ€Ž

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
# ๐Ÿซต OmniAuth::Identity
1414

15-
[![Version][๐Ÿ‘ฝversioni]][๐Ÿ‘ฝversion] [![License: MIT][๐Ÿ“„license-img]][๐Ÿ“„license-ref] [![Downloads Rank][๐Ÿ‘ฝdl-ranki]][๐Ÿ‘ฝdl-rank] [![Open Source Helpers][๐Ÿ‘ฝoss-helpi]][๐Ÿ‘ฝoss-help] [![Depfu][๐Ÿ”‘depfuiโ™ป๏ธ]][๐Ÿ”‘depfu] [![Coveralls Test Coverage][๐Ÿ”‘coveralls-img]][๐Ÿ”‘coveralls] [![CodeCov Test Coverage][๐Ÿ”‘codecoviโ™ป๏ธ]][๐Ÿ”‘codecov] [![QLTY Test Coverage][๐Ÿ”‘qlty-covi]][๐Ÿ”‘qlty-cov] [![QLTY Maintainability][๐Ÿ”‘qlty-mnti]][๐Ÿ”‘qlty-mnt] [![CI Heads][๐ŸšŽ3-hd-wfi]][๐ŸšŽ3-hd-wf] [![CI Runtime Dependencies @ HEAD][๐ŸšŽ12-crh-wfi]][๐ŸšŽ12-crh-wf] [![CI Current][๐ŸšŽ11-c-wfi]][๐ŸšŽ11-c-wf] [![CI JRuby][๐ŸšŽ10-j-wfi]][๐ŸšŽ10-j-wf] [![CI Supported][๐ŸšŽ6-s-wfi]][๐ŸšŽ6-s-wf] [![CI Legacy][๐ŸšŽ4-lg-wfi]][๐ŸšŽ4-lg-wf] [![CI Unsupported][๐ŸšŽ7-us-wfi]][๐ŸšŽ7-us-wf] [![CI Ancient][๐ŸšŽ1-an-wfi]][๐ŸšŽ1-an-wf] [![CI Test Coverage][๐ŸšŽ2-cov-wfi]][๐ŸšŽ2-cov-wf] [![CI Style][๐ŸšŽ5-st-wfi]][๐ŸšŽ5-st-wf] [![CI w/ committed Gemfile.lock][๐ŸšŽ13-k-wfi]][๐ŸšŽ13-k-wf]
15+
[![Version][๐Ÿ‘ฝversioni]][๐Ÿ‘ฝversion] [![License: MIT][๐Ÿ“„license-img]][๐Ÿ“„license-ref] [![Downloads Rank][๐Ÿ‘ฝdl-ranki]][๐Ÿ‘ฝdl-rank] [![Open Source Helpers][๐Ÿ‘ฝoss-helpi]][๐Ÿ‘ฝoss-help] [![Depfu][๐Ÿ”‘depfuiโ™ป๏ธ]][๐Ÿ”‘depfu] [![Coveralls Test Coverage][๐Ÿ”‘coveralls-img]][๐Ÿ”‘coveralls] [![CodeCov Test Coverage][๐Ÿ”‘codecoviโ™ป๏ธ]][๐Ÿ”‘codecov] [![QLTY Test Coverage][๐Ÿ”‘qlty-covi]][๐Ÿ”‘qlty-cov] [![QLTY Maintainability][๐Ÿ”‘qlty-mnti]][๐Ÿ”‘qlty-mnt] [![CI Heads][๐ŸšŽ3-hd-wfi]][๐ŸšŽ3-hd-wf] [![CI Runtime Dependencies @ HEAD][๐ŸšŽ12-crh-wfi]][๐ŸšŽ12-crh-wf] [![CI Current][๐ŸšŽ11-c-wfi]][๐ŸšŽ11-c-wf] [![CI JRuby][๐ŸšŽ10-j-wfi]][๐ŸšŽ10-j-wf] [![Deps Locked][๐ŸšŽ13-๐Ÿ”’๏ธ-wfi]][๐ŸšŽ13-๐Ÿ”’๏ธ-wf] [![Deps Unlocked][๐ŸšŽ14-๐Ÿ”“๏ธ-wfi]][๐ŸšŽ14-๐Ÿ”“๏ธ-wf] [![CI Supported][๐ŸšŽ6-s-wfi]][๐ŸšŽ6-s-wf] [![CI Legacy][๐ŸšŽ4-lg-wfi]][๐ŸšŽ4-lg-wf] [![CI Unsupported][๐ŸšŽ7-us-wfi]][๐ŸšŽ7-us-wf] [![CI Ancient][๐ŸšŽ1-an-wfi]][๐ŸšŽ1-an-wf] [![CI Test Coverage][๐ŸšŽ2-cov-wfi]][๐ŸšŽ2-cov-wf] [![CI Style][๐ŸšŽ5-st-wfi]][๐ŸšŽ5-st-wf] [![CI w/ committed Gemfile.lock][๐ŸšŽ13-k-wfi]][๐ŸšŽ13-k-wf]
1616

1717
---
1818

@@ -566,8 +566,10 @@ P.S. If you need help๏ธ, or want to say thanks, ๐Ÿ‘‡ Join the Discord.
566566
[๐ŸšŽ11-c-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/current.yml/badge.svg
567567
[๐ŸšŽ12-crh-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/current-runtime-heads.yml
568568
[๐ŸšŽ12-crh-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/current-runtime-heads.yml/badge.svg
569-
[๐ŸšŽ13-k-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/kitchen.yml
570-
[๐ŸšŽ13-k-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/kitchen.yml/badge.svg
569+
[๐ŸšŽ13-๐Ÿ”’๏ธ-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_locked.yml
570+
[๐ŸšŽ13-๐Ÿ”’๏ธ-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_locked.yml/badge.svg
571+
[๐ŸšŽ14-๐Ÿ”“๏ธ-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_unlocked.yml
572+
[๐ŸšŽ14-๐Ÿ”“๏ธ-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/deps_unlocked.yml/badge.svg
571573
[๐Ÿ’Žruby-2.3i]: https://img.shields.io/badge/Ruby-2.3-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
572574
[๐Ÿ’Žruby-2.4i]: https://img.shields.io/badge/Ruby-2.4-DF00CA?style=for-the-badge&logo=ruby&logoColor=white
573575
[๐Ÿ’Žruby-2.5i]: https://img.shields.io/badge/Ruby-2.5-DF00CA?style=for-the-badge&logo=ruby&logoColor=white

0 commit comments

Comments
ย (0)