-
-
Notifications
You must be signed in to change notification settings - Fork 166
239 lines (227 loc) · 8.28 KB
/
Copy pathplugins.yml
File metadata and controls
239 lines (227 loc) · 8.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
---
name: Plugin
# To debug locally:
# npm install -g act
# cd /Users/broz/src/solargraph/ && act pull_request -j run_solargraph_rails_specs # e.g.
on:
push:
branches: [master]
pull_request:
branches: ['*']
permissions:
contents: read
jobs:
regression:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 4.0 # 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-rails"' > .Gemfile
echo 'gem "solargraph-rspec"' >> .Gemfile
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .Gemfile
bundle install
- 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
- name: Ensure typechecking still works
run: bundle exec solargraph typecheck --level strong
# @todo Temporary, expect to revert in 0.60
continue-on-error: true
- name: Ensure specs still run
run: bundle exec rake spec
rails:
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
# See https://github.com/castwide/solargraph/actions/runs/19000135777/job/54265647107?pr=1119
rubygems: latest
bundler-cache: false
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: yq
version: 1.0
- name: Install gems
run: |
echo 'gem "solargraph-rails"' > .Gemfile
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .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
- name: Ensure typechecking still works
run: bundle exec solargraph typecheck --level strong
# @todo Temporary, expect to revert in 0.60
continue-on-error: true
- name: Ensure specs still run
run: bundle exec rake spec
rspec:
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: false
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: yq
version: 1.0
- name: Install gems
run: |
echo 'gem "solargraph-rspec"' >> .Gemfile
# Add optional gem to be able to typecheck related code
echo "gem 'vernier', '>1.0', '<2'" >> .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: bundle exec rbs collection update
- name: Ensure typechecking still works
run: bundle exec solargraph typecheck --level strong
# @todo Temporary, expect to revert in 0.60
continue-on-error: true
- name: Ensure specs still run
run: bundle exec rake 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
env:
SOLARGRAPH_CACHE: ${{ github.workspace }}/../solargraph-rspec/vendor/solargraph/cache
BUNDLE_PATH: ${{ github.workspace }}/../solargraph-rspec/vendor/bundle
steps:
- uses: actions/checkout@v3
- name: clone https://github.com/lekemula/solargraph-rspec/
run: |
cd ..
# git clone https://github.com/lekemula/solargraph-rspec.git
# pending https://github.com/lekemula/solargraph-rspec/pull/31
git clone https://github.com/apiology/solargraph-rspec.git
cd solargraph-rspec
git checkout test_solargraph_prereleases
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.4
rubygems: latest
bundler-cache: false
- name: Install gems
run: |
set -x
cd ../solargraph-rspec
echo "gem 'solargraph', path: '../solargraph'" >> Gemfile
bundle config path ${{ env.BUNDLE_PATH }}
bundle install --jobs 4 --retry 3
bundle exec appraisal install
# @todo some kind of appraisal/bundle conflict?
# https://github.com/castwide/solargraph/actions/runs/19038710934/job/54369767122?pr=1116
# /home/runner/work/solargraph/solargraph-rspec/vendor/bundle/ruby/3.1.0/gems/bundler-2.6.9/lib/bundler/runtime.rb:317:in
# `check_for_activated_spec!': You have already activated date
# 3.5.0, but your Gemfile requires date 3.4.1. Prepending
# `bundle exec` to your command may solve
# this. (Gem::LoadError)
bundle exec appraisal update date
# For some reason on ruby 3.1 it defaults to an old version: 1.3.2
# https://github.com/lekemula/solargraph-rspec/actions/runs/17814581205/job/50645370316?pr=22
# We update manually to the latest
bundle exec appraisal update rspec-rails
- name: Configure .solargraph.yml
run: |
cd ../solargraph-rspec
cp .solargraph.yml.example .solargraph.yml
- name: Solargraph generate RSpec gems YARD pins
run: |
cd ../solargraph-rspec
# solargraph-rspec's specs don't pass a workspace, so it
# doesn't know where to look for the RBS collection - let's
# not load one so that the solargraph gems command below works
rspec_gems=$(bundle exec appraisal ruby -r './lib/solargraph-rspec' -e 'puts Solargraph::Rspec::Gems.gem_names.join(" ")' 2>/dev/null | tail -n1)
bundle exec appraisal solargraph gems $rspec_gems
- name: Run specs
run: |
cd ../solargraph-rspec
bundle exec appraisal rspec --format progress
run_solargraph_rails_specs:
# check out solargraph-rails as well as this project, and point the former to use the latter as a local gem
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: clone solargraph-rails
run: |
cd ..
git clone https://github.com/iftheshoefritz/solargraph-rails.git
cd solargraph-rails
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
# solargraph-rails supports Ruby 3.0+
# This job uses 3.2 due to a problem compiling sqlite3 in earlier versions
ruby-version: '3.2'
bundler-cache: false
# 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
env:
MATRIX_RAILS_VERSION: "7.0"
MATRIX_RAILS_MAJOR_VERSION: '7'
- name: Run specs
run: |
BUNDLE_PATH="${GITHUB_WORKSPACE:?}/vendor/bundle"
export BUNDLE_PATH
cd ../solargraph-rails
bundle exec solargraph --version
bundle info solargraph
bundle info rbs
bundle info yard
ALLOW_IMPROVEMENTS=true bundle exec rake spec
env:
MATRIX_RAILS_VERSION: "7.0"
# @todo Temporary, expect to revert in 0.60
continue-on-error: true