Add integration tests for billing, performance, pricing, and user man… #3
This file contains hidden or 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: | ||
| # ---- Linting ---- | ||
| 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: Lint Ruby code (RuboCop) | ||
| run: bin/rubocop -f github | ||
| # ---- Test suite ---- | ||
| test: | ||
| runs-on: ubuntu-latest | ||
| services: | ||
| postgres: | ||
| image: postgres:15 | ||
| env: | ||
| POSTGRES_USER: postgres | ||
| POSTGRES_PASSWORD: postgres | ||
| POSTGRES_DB: activerabbit_test | ||
| ports: | ||
| - "5432:5432" | ||
| options: >- | ||
| --health-cmd="pg_isready -U postgres" | ||
| --health-interval=10s | ||
| --health-timeout=5s | ||
| --health-retries=5 | ||
| redis: | ||
| image: redis:7 | ||
| ports: | ||
| - "6379:6379" | ||
| options: >- | ||
| --health-cmd="redis-cli ping" | ||
| --health-interval=10s | ||
| --health-timeout=5s | ||
| --health-retries=5 | ||
| env: | ||
| RAILS_ENV: test | ||
| DATABASE_URL: postgres://postgres:postgres@localhost:5432/activerabbit_test | ||
| REDIS_URL: redis://localhost:6379/0 | ||
| 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: Prepare test database | ||
| run: | | ||
| bin/rails db:test:prepare | ||
| - name: Run Minitest suite | ||
| run: | | ||
| bin/rails test test/ | ||
| # ---- Security scans ---- | ||
| security_ruby: | ||
| 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 Rails app with Brakeman | ||
| run: bin/brakeman --no-pager | ||
| security_js: | ||
| 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: Audit JavaScript dependencies (importmap) | ||
| run: bin/importmap audit | ||