Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run test workflow on pull_request only [closes #129] #135

Merged
merged 1 commit into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions .github/workflows/autocorrect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: autocorrect

on:
schedule:
- cron: '29 6 * * 6'
- cron: "29 6 * * 6"

workflow_dispatch:

Expand All @@ -12,36 +12,36 @@ jobs:

strategy:
matrix:
ruby: [ 3.0 ]
ruby: [3.0]

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rake test
- name: Run linter
run: bundle exec rubocop -A
continue-on-error: true
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: update/lint-autocorrect
delete-branch: true
commit-message: '🔧 autocorrect by Rubocop'
title: '[rubocop] Automatic corrections'
body: |
Please review automatic changes proposed by `rubocop -a`.
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rake test
- name: Run linter
run: bundle exec rubocop -A
continue-on-error: true
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
branch: update/lint-autocorrect
delete-branch: true
commit-message: "🔧 autocorrect by Rubocop"
title: "[rubocop] Automatic corrections"
body: |
Please review automatic changes proposed by `rubocop -a`.
85 changes: 42 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: build

on:
pull_request:
push:

jobs:
test:
Expand All @@ -11,56 +10,56 @@ jobs:
strategy:
fail-fast: false
matrix:
ruby: [ jruby, 3.0, 3.1, 3.2 ]
ruby: [jruby, 3.0, 3.1, 3.2]

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rake test
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: coverage/coverage.xml
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run tests
run: bundle exec rake test
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: coverage/coverage.xml

lint:
needs: test
runs-on: ubuntu-latest

strategy:
matrix:
ruby: [ 3.0 ]
ruby: [3.0]

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run linter
run: bundle exec rubocop
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
- name: Cache dependencies
uses: actions/cache@v3
with:
path: vendor/bundle
key: ${{ runner.os }}-${{ matrix.ruby }}-gems-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: |
${{ runner.os }}-${{ matrix.ruby }}-gems-
- name: Install dependencies
run: |
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3
- name: Run linter
run: bundle exec rubocop
Loading