-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from kimkim0814/ci-setup
CI setup
- Loading branch information
Showing
1 changed file
with
47 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,47 @@ | ||
name: Run rspec, rubocop | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
jobs: | ||
rspec: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
services: | ||
mysql: | ||
image: mysql:8.0 | ||
ports: | ||
- 3306:3306 | ||
env: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: yes | ||
options: --health-cmd "mysqladmin ping" --health-interval 10s --health-timeout 5s --health-retries 10 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
bundler-cache: true | ||
|
||
- name: Cache node modules | ||
uses: actions/cache@v2 | ||
with: | ||
path: node_modules | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Bundler and gem install | ||
run: | | ||
gem install bundler | ||
bundle install --jobs 4 --retry 3 --path vendor/bundle | ||
- name: Yarn install | ||
run: yarn install --check-files | ||
|
||
- name: Run rspec | ||
run: bundle exec rspec |