Skip to content

Commit

Permalink
Merge branch 'main' into andyw8/revise-testing-approach
Browse files Browse the repository at this point in the history
  • Loading branch information
andyw8 committed Jun 20, 2024
2 parents a44dc3f + 5704d93 commit 379968e
Show file tree
Hide file tree
Showing 73 changed files with 3,629 additions and 2,468 deletions.
1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ updates:
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 100
reviewers:
- "Shopify/ruby-dev-exp"
labels:
Expand Down
26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,10 @@ jobs:
gemfile:
- Gemfile
- gemfiles/Gemfile-rails-main
ruby: ["3.0", "3.1", "3.2", "3.3"]
ruby: ["3.1", "3.2", "3.3"]
include:
- gemfile: "gemfiles/Gemfile-rails-main"
experimental: true
exclude:
- os: "windows-latest"
ruby: "3.0"
- Gemfile: "gemfiles/Gemfile-rails-main" # needs Ruby 3.1
ruby: "3.0"
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
Expand All @@ -42,15 +37,24 @@ jobs:
bundler-cache: true
cache-version: 7

- name: Check if documentation is up to date
run: bundle exec rake ruby_lsp:check_docs
- name: Run tests
run: bundle exec rake
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler: latest
bundler-cache: true

- name: Typecheck
if: matrix.os != 'windows-latest'
run: bundle exec srb tc

- name: Lint Ruby files
run: bin/rubocop

- name: Run tests
run: bin/rails db:setup && bin/rails db:migrate && bin/rails test
- name: Check if documentation is up to date
run: bundle exec rake ruby_lsp:check_docs
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# CONTRIBUTING

Bug reports and pull requests are welcome on GitHub at https://github.com/Shopify/ruby-lsp-rails. This project is
intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the
[Contributor Covenant](https://github.com/Shopify/ruby-lsp-rails/blob/main/CODE_OF_CONDUCT.md) code of conduct.

# Developing on Ruby LSP

For general information about developing, refer to the to the [documentation](https://github.com/Shopify/ruby-lsp/blob/main/CONTRIBUTING.md#debugging-with-vs-code) for Ruby LSP itself.

### Manually testing a change

The repo includes a dummy Rails app in `test/dummy`. If you're developing a feature, you can add new code to it for testing.

To test with a real Rails application, you can add a Gemfile entry for `ruby-lsp-rails` and point it to your local checkout:

```ruby
gem "ruby-lsp-rails", path: "../ruby-lsp-rails"
```

Or to a branch in your fork:

```ruby
gem "ruby-lsp-rails", github: "USERNAME/ruby-lsp-rails", branch: "your_branch"
```

### Running the test suite

To set up the database for the dummy Rails app, and run the full test suite:

```shell
bundle exec rake
```

Tests are written as `ActiveSupport::TestCase` tests, so an individual test can be run with:

```shell
bin/rails test test/my_test.rb
```
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@ gem "tapioca", "~> 0.13", require: false, platforms: :ruby
gem "psych", "~> 5.1", require: false
gem "rails"
gem "webmock"

platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo"
gem "tzinfo-data"
end
Loading

0 comments on commit 379968e

Please sign in to comment.