diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..750bcb53 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,27 @@ +name: Lint + +on: [pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + with: + ref: ${{ github.event.pull_request.head.ref }} + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 2.7.0 + bundler-cache: true + - name: Run linters with autofix + run: bundle exec rubocop --auto-correct-all + - name: Push any fixes + run: | + git config --global user.email "lint-bot" + git config --global user.name "lint-bot" + git add --all + git commit -m "Code style fixes" || exit 0 + git push + - name: Re-run linter + run: bundle exec rubocop diff --git a/.github/workflows/main.yml b/.github/workflows/tests.yml similarity index 83% rename from .github/workflows/main.yml rename to .github/workflows/tests.yml index 846e73b1..8138daeb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: Ruby +name: Tests on: push: @@ -23,5 +23,5 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true - - name: Run the default task - run: bundle exec rake + - name: Run tests + run: bundle exec rspec diff --git a/.gitignore b/.gitignore index 5fff1d9c..ee2b2dcd 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ pkg +.bundle/config +vendor/bundle