List Yardoc methods in GH Workflow #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake | |
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby | |
name: Ruby | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
permissions: | |
contents: read | |
jobs: | |
test: | |
name: Tests (ruby v${{ matrix.ruby-version }}) | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
ruby-version: ["2.6", "2.7", "3.1"] | |
steps: | |
- name: Checkout solargraph-rspec | |
uses: actions/checkout@v4 | |
with: | |
path: solargraph-rspec | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: ${{ matrix.ruby-version }} | |
bundler-cache: false | |
- name: Cache Ruby gems | |
uses: actions/cache@v3 | |
with: | |
path: solargraph-rspec/vendor/bundle | |
key: bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('solargraph-rspec/Gemfile.lock') }} | |
restore-keys: | | |
bundle-use-ruby-${{ matrix.os }}-${{ matrix.ruby-version }}- | |
- name: Install dependencies | |
run: | | |
cd solargraph-rspec | |
bundle config path vendor/bundle | |
bundle install --jobs 4 --retry 3 | |
- name: Run Rubocop | |
run: cd solargraph-rspec && bundle exec rubocop | |
- name: Cache Yardocs | |
id: cache-yardocs | |
uses: actions/cache@v3 | |
with: | |
path: solargraph-rspec/.yardoc | |
key: yardoc-${{ matrix.os }}-${{ matrix.ruby-version }}-${{ hashFiles('solargraph-rspec/Gemfile.lock') }} | |
restore-keys: | | |
yardoc-${{ matrix.os }}-${{ matrix.ruby-version }}- | |
- name: Set up yardocs | |
if: steps.cache-yardocs.outputs.cache-hit != 'true' | |
run: cd solargraph-rspec && bundle exec yard gems --verbose | |
- name: List all Yardoc constants and methods | |
run: | | |
cd solargraph-rspec | |
bundle config path vendor/bundle | |
bundle exec yard list | |
bundle exec gem list | |
- name: Run tests | |
run: cd solargraph-rspec && bundle exec rspec --format progress | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
directory: solargraph-rspec/coverage |