fix: fixed the position of text #3
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
name: "Ruby on Rails CI" | |
on: | |
[push, pull_request, workflow_dispatch] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:11-alpine | |
ports: | |
- "5432:5432" | |
env: | |
POSTGRES_DB: rails_test | |
POSTGRES_USER: rails | |
POSTGRES_PASSWORD: password | |
redis: | |
image: redis:alpine | |
ports: ["6379:6379"] | |
options: --entrypoint redis-server | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: "postgres://rails:password@localhost:5432/rails_test" | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 100 | |
submodules: recursive | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 # v1.115.3 | |
with: | |
bundler-cache: true | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: '16' | |
cache: 'yarn' | |
- name: Install reviewdog | |
uses: reviewdog/action-setup@v1 | |
with: | |
reviewdog_version: latest | |
- run: yarn install --frozen-lockfile --immutable | |
- name: Copy the sample ENV Config | |
run: cp .env.example .env | |
- name: Set up database schema | |
run: bin/rails db:schema:load | |
- name: Run data migration tasks | |
run: bin/rails data:migrate | |
- name: Build assets | |
run: yarn run build | |
- name: Configure keys | |
run: | | |
openssl genrsa -out config/private.pem 2048 | |
openssl rsa -in config/private.pem -outform PEM -pubout -out config/public.pem | |
- name: Run tests | |
run: bundle exec rspec | |
- uses: aki77/delete-pr-comments-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
bodyContains: "[undercover]" | |
noReply: "true" | |
- name: Run reviewdog | |
env: | |
REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.github_token }} | |
run: | | |
git fetch --no-tags | |
reviewdog -reporter=github-pr-review -runners=undercover --fail-on-error | |
- name: Static type checking | |
run: | | |
bundle exec rbs collection install | |
bundle exec steep check | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Install Ruby and gems | |
uses: ruby/setup-ruby@v1 # v1.115.3 | |
with: | |
bundler-cache: true | |
- name: Security audit dependencies | |
run: bundle exec bundler-audit --update | |
- name: Lint Ruby files | |
run: bundle exec rubocop --parallel |