Skip to content

Commit

Permalink
Add Github Action for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
alpaca-tc committed Jun 3, 2023
1 parent e2bbfbe commit 3b8a93b
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Ruby

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

permissions:
contents: read

jobs:
rubocop:
runs-on: ubuntu-latest
strategy:
matrix:
ruby-version: ['3.0', '3.1']

steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Run rubocop
run: bundle exec rubocop

test:
runs-on: ubuntu-latest
strategy:
matrix:
gemfile: ['6.1_stable', '7.0_stable']
ruby-version: ['3.0', '3.1']
env:
BUNDLE_GEMFILE: ${{ github.workspace }}/gemfiles/${{ matrix.gemfile }}.gemfile
ACTIVERECORD_ENCRYPTION_PASSWORD: 'password'
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
- name: Shutdown Ubuntu MySQL (SUDO)
run: sudo service mysql stop # Shutdown the Default MySQL, "sudo" is necessary, please not remove it
- name: Set up MySQL
uses: mirromutth/mysql-action@v1.1
with:
mysql database: active_record_encryption
mysql user: 'root'
mysql password: 'password'
- name: Run tests
run: bundle exec rspec

0 comments on commit 3b8a93b

Please sign in to comment.