-
Notifications
You must be signed in to change notification settings - Fork 0
Parallel rspec #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2026-01-31
Are you sure you want to change the base?
Parallel rspec #27
Changes from all commits
5749c42
2888594
afb3fe0
310408e
750b371
f8da41c
d4a21e6
2e94d97
70f0c5f
96ef0c5
7a05bb2
c26e6d6
f2b16af
0adb139
13eda65
a1629b5
e46e6b3
dba7d29
8a4d722
f8260b4
2dabf64
4949ce1
51f34ce
dee9fb6
d671728
0b8bbce
cb976e2
9c92f57
d39049e
8dc1f38
cf3dfb3
d67378e
7edf8b8
1965e63
0cdb4ef
0eaf53d
12b2f30
1c5c969
bcbf9a9
936d3b4
59a0bd6
38d4a96
535f21d
1818382
9adce4c
07a8940
d3cc536
6dc4f94
99f55d3
ee07001
99c8241
5a86947
9eb3a6a
74c7970
c6702c9
6bc40d6
96daa5d
e8a33a5
6ba49d0
4568e8d
00c19e3
cbc9d09
b5ae43f
94f1229
9138a73
75fd252
056c3ca
d866dc0
203a4f8
854e916
4ae10a5
3014abe
c0c340e
c210441
83d8da9
819bf43
8a220c4
547276b
27a171c
3dd98b0
be64b85
83ce3d3
6c80bae
07db6a3
b6ee022
ea94901
a6a4678
a61c785
1be808f
215c23e
3b4f3d2
525c1b3
e912db6
56bb7c5
40fe7fd
102d357
8089dd5
a5e2bde
a4dfc52
a07be09
9953848
2291d71
1b0ad59
6a6efe1
6943b50
2adc097
b6d8eb6
474a29f
0e885ff
642edef
9a863a3
a6926e6
fd86a5e
da9e506
a64e773
be93692
a82b6fd
cc37729
fd69799
b2d8fb6
38a93e2
fc6e874
849747e
1669309
5e72ef4
de8d4ac
9f7cd02
d801cf1
7704c91
8fee670
0fa1c00
68cf467
3e3be1a
c4c1e8f
96482b8
b4556c0
5c235dc
df0c205
b34c3d0
eb79d3b
e981123
31648e3
a55b54a
0e08bf8
2af160d
53676c5
59b460d
b5bcd4b
dda8322
a82ab1a
f7b84a1
c5d86e3
25d01ef
73de5c5
25457a8
3e85551
d10e029
a4bd2bd
16fb502
d707e04
b8b18c4
aa8979c
fefdeba
792e857
23ccc34
6e06cd2
a1aeac2
81b3ae0
91b8852
013deaf
98953f7
e0b28e0
c6d7ea9
1f599e9
17d3a2b
093bd2a
48b4540
b1bdc91
a4341d1
5283a52
cb06aea
a5d028d
5cd2d83
07acb5c
1e3f1a4
30812e7
7246007
940fc3f
055281f
0f2b5f3
66f9cc1
eca6e43
b0356db
1423df5
b109d57
5cad315
0094cfd
71b2930
d75676b
c5eb7d5
75e6a4e
0c2bfb5
193852d
7b2cf31
676a616
ba9645c
436f90c
d2db644
4c000a8
c5f257d
ab906f5
922f077
afb2531
b4eecad
59b1df9
7402c66
de2fd1d
9f3f644
5bc3207
a1672ad
ddb5276
f4a1501
86060f0
454aa77
f6e70c6
e076205
0324b2f
baa84a6
04e39b5
d0bcb25
49a6d3c
8171aa0
2ec00a4
1dccd5d
7d9b787
df9ad9b
2308868
7177237
2f6e441
e7873d8
90476b7
5231a27
bef158b
49faea6
5219dec
aea00fc
9b9db98
b507345
3eb0db1
a74e9be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,10 @@ | ||
| #!/bin/bash | ||
|
|
||
| if [[ "$(uname)" == "Darwin" ]]; then | ||
| WORKERS=$(sysctl -n hw.physicalcpu) | ||
| export WORKERS | ||
| fi | ||
|
|
||
| # current git branch | ||
| SOLARGRAPH_FORCE_VERSION=0.0.1.dev-$(git rev-parse --abbrev-ref HEAD | tr -d '\n' | tr -d '/' | tr -d '-'| tr -d '_') | ||
| export SOLARGRAPH_FORCE_VERSION |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -15,7 +15,7 @@ permissions: | |
| contents: read | ||
|
|
||
| jobs: | ||
| regression: | ||
| rails_and_rspec_typechecking: | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm breaking these steps into parallel items for time savings and also clearing up the names a bit |
||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
|
|
@@ -44,9 +44,52 @@ jobs: | |
| run: bundle exec rbs collection update | ||
| - name: Ensure typechecking still works | ||
| run: bundle exec solargraph typecheck --level strong | ||
| rails_and_rspec_specs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.4 | ||
| bundler-cache: true | ||
| - uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: yq | ||
| version: 1.0 | ||
| - name: Install gems | ||
| run: | | ||
| echo 'gem "solargraph-rails"' > .Gemfile | ||
| echo 'gem "solargraph-rspec"' >> .Gemfile | ||
| bundle install | ||
| bundle update --pre rbs | ||
| - name: Configure to use plugins | ||
| run: | | ||
| bundle exec solargraph config | ||
| yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml | ||
| yq -yi '.plugins += ["solargraph-rspec"]' .solargraph.yml | ||
| - name: Install gem types | ||
| run: | | ||
| bundle exec rbs collection update | ||
| # avoid trying to do this in parallel during the specs | ||
| time bundle exec solargraph gems core stdlib default | ||
| - name: Ensure specs still run | ||
| run: bundle exec rake spec | ||
| rails: | ||
| run: | | ||
| # Speed up some of the bundle installs we run inside the tests | ||
| # as well when we're testing different solargraph usage | ||
| # scenarios. This is already set in the local bundle config by | ||
| # the setup-ruby action. | ||
| # | ||
| # See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically | ||
| bundle config set path $PWD/vendor/bundle | ||
|
|
||
| SIMPLECOV_DISABLED=true | ||
| export SIMPLECOV_DISABLED | ||
|
|
||
| bundle exec rake full_spec | ||
| rails_typechecking: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
|
|
@@ -57,7 +100,7 @@ jobs: | |
| ruby-version: 3.4 # keep same as typecheck.yml | ||
| # See https://github.com/castwide/solargraph/actions/runs/19000135777/job/54265647107?pr=1119 | ||
| rubygems: latest | ||
| bundler-cache: false | ||
| bundler-cache: true | ||
| - uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: yq | ||
|
|
@@ -75,9 +118,51 @@ jobs: | |
| run: bundle exec rbs collection update | ||
| - name: Ensure typechecking still works | ||
| run: bundle exec solargraph typecheck --level strong | ||
| rails_specs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.4 | ||
| rubygems: latest | ||
| bundler-cache: true | ||
| - uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: yq | ||
| version: 1.0 | ||
| - name: Install gems | ||
| run: | | ||
| echo 'gem "solargraph-rails"' > .Gemfile | ||
| bundle install | ||
| bundle update --pre rbs | ||
| - name: Configure to use plugins | ||
| run: | | ||
| bundle exec solargraph config | ||
| yq -yi '.plugins += ["solargraph-rails"]' .solargraph.yml | ||
| - name: Install gem types | ||
| run: | | ||
| bundle exec rbs collection update | ||
| # avoid trying to do this in parallel during the specs | ||
| bundle exec solargraph gems core stdlib | ||
| - name: Ensure specs still run | ||
| run: bundle exec rake spec | ||
| rspec: | ||
| run: | | ||
| # Speed up some of the bundle installs we run inside the tests | ||
| # as well when we're testing different solargraph usage | ||
| # scenarios. This is already set in the local bundle config by | ||
| # the setup-ruby action. | ||
| # | ||
| # See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically | ||
| bundle config set path $PWD/vendor/bundle | ||
|
|
||
| SIMPLECOV_DISABLED=true | ||
| export SIMPLECOV_DISABLED | ||
|
|
||
| bundle exec rake full_spec | ||
| rspec_typechecking: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
|
|
@@ -86,7 +171,7 @@ jobs: | |
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.4 # keep same as typecheck.yml | ||
| bundler-cache: false | ||
| bundler-cache: true | ||
| - uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: yq | ||
|
|
@@ -104,9 +189,53 @@ jobs: | |
| run: bundle exec rbs collection update | ||
| - name: Ensure typechecking still works | ||
| run: bundle exec solargraph typecheck --level strong | ||
| rspec_specs: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up Ruby | ||
| uses: ruby/setup-ruby@v1 | ||
| with: | ||
| ruby-version: 3.4 # keep same as typecheck.yml | ||
| bundler-cache: true | ||
| - uses: awalsh128/cache-apt-pkgs-action@latest | ||
| with: | ||
| packages: yq | ||
| version: 1.0 | ||
| - name: Install gems | ||
| run: | | ||
| echo 'gem "solargraph-rspec"' >> .Gemfile | ||
| bundle install | ||
| bundle update --pre rbs | ||
| - name: Configure to use plugins | ||
| run: | | ||
| bundle exec solargraph config | ||
| yq -yi '.plugins += ["solargraph-rspec"]' .solargraph.yml | ||
| - name: Install gem types | ||
| run: | | ||
| set -x | ||
|
|
||
| bundle exec rbs collection update | ||
|
|
||
| rspec_gems=$(bundle exec ruby -r 'solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1) | ||
| # avoid trying to do this in parallel during the specs | ||
| bundle exec solargraph gems core stdlib $rspec_gems diff-lcs addressable ast rexml crack hashdiff rspec-support bigdecimal public_suffix | ||
| - name: Ensure specs still run | ||
| run: bundle exec rake spec | ||
| run: | | ||
| # Speed up some of the bundle installs we run inside the tests | ||
| # as well when we're testing different solargraph usage | ||
| # scenarios. This is already set in the local bundle config by | ||
| # the setup-ruby action. | ||
| # | ||
| # See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically | ||
| bundle config set path $PWD/vendor/bundle | ||
|
|
||
| SIMPLECOV_DISABLED=true | ||
| export SIMPLECOV_DISABLED | ||
|
|
||
| bundle exec rake full_spec | ||
| run_solargraph_rspec_specs: | ||
| # check out solargraph-rspec as well as this project, and point the former to use the latter as a local gem | ||
| runs-on: ubuntu-latest | ||
|
|
@@ -129,14 +258,14 @@ jobs: | |
| with: | ||
| ruby-version: 3.4 | ||
| rubygems: latest | ||
| bundler-cache: false | ||
| bundler-cache: true | ||
| - name: Install gems | ||
| run: | | ||
| set -x | ||
|
|
||
| cd ../solargraph-rspec | ||
| echo "gem 'solargraph', path: '../solargraph'" >> Gemfile | ||
| bundle config path ${{ env.BUNDLE_PATH }} | ||
| bundle config set path ${{ env.BUNDLE_PATH }} | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The former invocation now gives a deprecation warning |
||
| bundle install --jobs 4 --retry 3 | ||
| bundle exec appraisal install | ||
| # @todo some kind of appraisal/bundle conflict? | ||
|
|
@@ -166,7 +295,21 @@ jobs: | |
| bundle exec appraisal solargraph gems $rspec_gems | ||
| - name: Run specs | ||
| run: | | ||
| # Speed up some of the bundle installs we run inside the tests | ||
| # as well when we're testing different solargraph usage | ||
| # scenarios. This is already set in the local bundle config by | ||
| # the setup-ruby action. | ||
| # | ||
| # See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically | ||
| bundle config set path $PWD/vendor/bundle | ||
| cd ../solargraph-rspec | ||
|
|
||
| SIMPLECOV_DISABLED=true | ||
| export SIMPLECOV_DISABLED | ||
|
|
||
| # avoid trying to do this in parallel during the specs | ||
| bundle exec solargraph gems core stdlib | ||
| bundle exec appraisal rspec --format progress | ||
|
|
||
| run_solargraph_rails_specs: | ||
|
|
@@ -184,42 +327,58 @@ jobs: | |
| with: | ||
| # solargraph-rails supports Ruby 3.0+ | ||
| ruby-version: '3.0' | ||
| bundler-cache: false | ||
| bundler-cache: true | ||
| # https://github.com/apiology/solargraph/actions/runs/19400815835/job/55508092473?pr=17 | ||
| rubygems: latest | ||
| bundler: latest | ||
| env: | ||
| MATRIX_RAILS_VERSION: "7.0" | ||
| - name: Install gems | ||
| run: | | ||
| set -x | ||
| BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle" | ||
| export BUNDLE_PATH | ||
| cd ../solargraph-rails | ||
| echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile | ||
| bundle install | ||
| bundle update --pre rbs | ||
| RAILS_DIR="$(pwd)/spec/rails7" | ||
| export RAILS_DIR | ||
| cd ${RAILS_DIR} | ||
| bundle install | ||
| bundle exec --gemfile ../../Gemfile rbs --version | ||
| bundle exec --gemfile ../../Gemfile rbs collection install | ||
| cd ../../ | ||
| # bundle exec rbs collection init | ||
| # bundle exec rbs collection install | ||
| set -x | ||
| # Share caches to speed up bundle install | ||
| # | ||
| # See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically | ||
| cd ../solargraph-rails | ||
| echo "gem 'solargraph', path: '${GITHUB_WORKSPACE:?}'" >> Gemfile | ||
| bundle install | ||
| bundle update --pre rbs | ||
| env: | ||
| MATRIX_RAILS_VERSION: "7.0" | ||
| MATRIX_RAILS_MAJOR_VERSION: '7' | ||
| - name: Install gem types | ||
| run: | | ||
| cd ../solargraph-rails | ||
|
|
||
| RAILS_DIR="$(pwd)/spec/rails7" | ||
| export RAILS_DIR | ||
| cd ${RAILS_DIR} | ||
| bundle install | ||
| bundle exec --gemfile ../../Gemfile rbs --version | ||
| bundle exec --gemfile ../../Gemfile rbs collection install | ||
| cd ../../ | ||
| # bundle exec rbs collection init | ||
| # bundle exec rbs collection install | ||
| env: | ||
| MATRIX_RAILS_VERSION: "7.0" | ||
| MATRIX_RAILS_MAJOR_VERSION: '7' | ||
| - name: Run specs | ||
| run: | | ||
| BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle" | ||
| export BUNDLE_PATH | ||
| # Share caches to speed up bundle install | ||
| # | ||
| # See | ||
| # https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically | ||
| bundle config set path $PWD/vendor/bundle | ||
| cd ../solargraph-rails | ||
| bundle exec solargraph --version | ||
| bundle info solargraph | ||
| bundle info rbs | ||
| bundle info yard | ||
|
|
||
| SIMPLECOV_DISABLED=true | ||
| export SIMPLECOV_DISABLED | ||
|
|
||
| ALLOW_IMPROVEMENTS=true bundle exec rake spec | ||
| env: | ||
| MATRIX_RAILS_VERSION: "7.0" | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a pretty big speedup. If having the very latest version of a dependency is vital, we can add a bundle update statement later on.