update ci.yml #165
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: | |
branches: ["main"] | |
pull_request: | |
branches: ["*"] | |
defaults: | |
run: | |
shell: bash | |
working-directory: api | |
jobs: | |
scan: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install native packages | |
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: ./api | |
bundler-cache: true | |
- name: Scan for security vulnerabilities | |
run: bin/brakeman | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install native packages | |
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git pkg-config | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
working-directory: ./api | |
bundler-cache: true | |
- name: Lint code for consistent style | |
run: bin/rubocop | |
# test: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout code | |
# uses: actions/checkout@v4 | |
# - name: Install Ruby and gems | |
# uses: ruby/setup-ruby@v1 | |
# with: | |
# working-directory: ./api | |
# bundler-cache: true | |
# - name: Run docker | |
# run: cp .env.example .env && docker compose up -d | |
# - name: Set up database schema | |
# run: RAILS_ENV=test docker compose run api rails db:create db:migrate db:schema:load | |
# - name: Run tests | |
# run: bundle exec rspec |