Skip to content

Commit

Permalink
add ci workflow for pull requests
Browse files Browse the repository at this point in the history
  • Loading branch information
msuliq committed Apr 15, 2023
1 parent 42f72bc commit 7e5a0c9
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 31 deletions.
32 changes: 1 addition & 31 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,9 @@
name: Ruby CI
name: Gem deployment
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.1"
bundler-cache: true
- run: bundle exec rubocop
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["2.7.7", "3.2.1"]
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Bundle audit
run: bundle exec bundle-audit --update
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake test
build:
name: Build and publish
runs-on: ubuntu-latest
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Pull request
on:
pull_request:
branches:
- main
jobs:
rubocop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.2.1"
bundler-cache: true
- run: bundle exec rubocop
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
ruby: ["2.7.7", "3.2.1"]
steps:
- uses: actions/checkout@v3
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby }}
bundler-cache: true
- name: Bundle audit
run: bundle exec bundle-audit --update
- name: Install dependencies
run: bundle install
- name: Run tests
run: bundle exec rake test

0 comments on commit 7e5a0c9

Please sign in to comment.