-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
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 |