Skip to content

Merge branch 'master' into Feature#5214 #1

Merge branch 'master' into Feature#5214

Merge branch 'master' into Feature#5214 #1

Workflow file for this run

name: "Ruby on Rails CI"
on:
[push, pull_request, workflow_dispatch]
jobs:
test:
permissions:
pull-requests: write
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-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@v4
with:
fetch-depth: 100
submodules: recursive
- name: Install Ruby and gems
uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'yarn'
- name: Install Dependencies for canvas
run: |
sudo apt-get update
sudo apt-get install -y libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
- 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
- name: Keep screenshots from failed system tests
uses: actions/upload-artifact@v4
if: failure()
with:
name: screenshots
path: ${{ github.workspace }}/tmp/capybara
if-no-files-found: ignore
- 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
with:
bundler-cache: true
- name: Security audit dependencies
run: bundle exec bundler-audit --update
- name: Lint Ruby files
run: bundle exec rubocop --parallel