Stimulusのdebug modeをオフにした #314
Workflow file for this run
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: CI | |
on: | |
pull_request: | |
push: | |
branches: [main] | |
jobs: | |
audit: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
- name: Scan for common Rails security vulnerabilities using static analysis | |
run: bin/brakeman -q -w2 --no-pager --skip-libs | |
- name: Scan for security vulnerabilities in JavaScript dependencies | |
run: bin/importmap audit | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
- name: Setup Node.js | |
uses: actions/[email protected] | |
with: | |
node-version: '20.15.1' | |
- name: Lint code for consistent style | |
run: bin/rubocop -f github | |
- name: Lint Slim templates for consistent style | |
run: bundle exec slim-lint app/views | |
- name: Install dependencies | |
run: npm install | |
- name: Lint JavaScript files | |
run: npm run lint | |
test: | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres:17 | |
ports: | |
- "5432:5432" | |
env: | |
POSTGRES_DB: pix_pick_test | |
POSTGRES_USER: unikounio | |
POSTGRES_PASSWORD: password | |
env: | |
RAILS_ENV: test | |
DATABASE_URL: "postgres://unikounio:password@localhost:5432/pix_pick_test" | |
RAILS_MASTER_KEY: ${{ secrets.PIXPICK_MASTER_KEY }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Ruby | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: .ruby-version | |
bundler-cache: true | |
- name: Install dependencies | |
run: sudo apt-get update && sudo apt-get install -y libvips42 | |
- name: Set up DB | |
run: bin/rails db:migrate | |
- name: Precompile assets | |
run: RAILS_ENV=test bundle exec rails assets:precompile | |
- name: Run tests | |
run: bundle exec rspec |