Skip to content

Update: Update engine #187

Update: Update engine

Update: Update engine #187

Workflow file for this run

name: "[backend] Lint and Test"
on:
push:
paths:
- "backend/**"
- ".github/workflows/backend-*.yml"
workflow_dispatch:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Get ruby version
id: ruby-version
run: |
echo RUBY_VERSION=$(cat backend/.ruby-version) >> $GITHUB_OUTPUT
- name: Setup ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ steps.ruby-version.outputs.RUBY_VERSION }}
# - name: Cache gems
# uses: actions/cache@v3
# id: cache-gems
# with:
# path: vendor/bundle
# key: ${{ runner.os }}-bundler-${{ hashFiles('**/Gemfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-bundler-
# FIXME: Fix after https://github.com/actions/runner/issues/449
- name: Install gems
if: steps.cache-gems.outputs.cache-hit != 'true'
working-directory: ./backend
run: |
bundle config path vendor/bundle
bundle config set frozen 'true'
bundle install --jobs 4 --retry 3
- name: Run backend lint
working-directory: ./backend
run: |
pwd
bundle exec rake lint
- name: Run backend test
working-directory: ./backend
run: |
pwd
cp ../docker-compose.dev.yml ../docker-compose.yml
docker compose --env-file ../.env.test --profile test up -d
cp ../.env.test ../.env
bundle exec rake parallel:setup
bundle exec rake parallel:spec
build:
runs-on: ubuntu-latest
if: github.ref_name == 'main'
needs:
- check
permissions:
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Build image
uses: ./.github/actions/build
with:
directory-name: backend