Followup to #1083 #734
This file contains hidden or 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
--- | |
# To debug locally: | |
# npm install -g act | |
# act pull_release -j overcommit | |
name: Linting | |
on: | |
workflow_dispatch: {} | |
pull_request: | |
branches: [ master ] | |
push: | |
branches: | |
- 'main' | |
tags: | |
- 'v*' | |
permissions: | |
pull-requests: write | |
contents: read | |
jobs: | |
overcommit: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
# Number of commits to fetch. 0 indicates all history for all branches and tags. | |
with: | |
fetch-depth: 0 | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: 3.4 | |
bundler: latest | |
bundler-cache: true | |
cache-version: 2025-06-06 | |
- name: Update to best available RBS | |
run: | | |
bundle update rbs # use latest available for this Ruby version | |
- name: Restore cache of gem annotations | |
id: dot-cache-restore | |
uses: actions/cache/restore@v4 | |
with: | |
key: | | |
2025-06-26-09-${{ runner.os }}-dot-cache-${{ hashFiles('Gemfile.lock') }} | |
restore-keys: | | |
2025-06-26-09-${{ runner.os }}-dot-cache | |
2025-06-26-09-${{ runner.os }}-dot-cache- | |
path: | | |
/home/runner/.cache/solargraph | |
- name: Install gem types | |
run: bundle exec rbs collection install | |
- name: Overcommit | |
run: | | |
bundle exec overcommit --sign | |
SOLARGRAPH_ASSERTS=on bundle exec overcommit --run --diff origin/master | |
rubocop: | |
name: rubocop | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: ruby/setup-ruby@1a615958ad9d422dd932dc1d5823942ee002799f # v1.227.0 | |
with: | |
ruby-version: '3.3' | |
bundler-cache: true | |
- uses: reviewdog/action-rubocop@fcb74ba274da10b18d038d0bcddaae3518739634 # v2.21.2 | |
with: | |
reporter: github-pr-check | |
skip_install: true | |
use_bundler: true | |
rubocop_extensions: 'rubocop-rspec:gemfile rubocop-rake:gemfile rubocop-yard:gemfile' | |
rubocop_flags: '-c .rubocop.yml' | |
fail_level: info | |
rubocop_version: Gemfile | |
level: info | |
rbs_validate: | |
name: rbs validate | |
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: false | |
- name: Install gems | |
run: bundle install | |
- name: Run rbs validate | |
run: bundle exec rbs validate | |
rubocop_todo: | |
name: .rubocop_todo.yml | |
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: false | |
- name: Install gems | |
run: bundle install | |
- name: Run RuboCop | |
run: bundle exec rubocop -c .rubocop.yml | |
- name: Run RuboCop against todo file | |
continue-on-error: true | |
run: | | |
bundle exec rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp | |
if [ -n "$(git status --porcelain)" ] | |
then | |
git status --porcelain | |
git diff -u . | |
>&2 echo "Please fix deltas if bad or run 'bundle exec rubocop --auto-gen-config --no-exclude-limit --no-offense-counts --no-auto-gen-timestamp' and push up changes if good" | |
exit 1 | |
fi |