Repository navigation
UI column improvements, for collapsing and uncollapsing, as well as #16
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: | |
| scan_ruby: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Scan for common Rails security vulnerabilities using static analysis | |
| run: bin/brakeman --no-pager | |
| - name: Scan for known security vulnerabilities in gems used | |
| run: bin/bundler-audit | |
| scan_js: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Scan for security vulnerabilities in JavaScript dependencies | |
| run: bin/importmap audit | |
| lint: | |
| runs-on: ubuntu-latest | |
| env: | |
| RUBOCOP_CACHE_ROOT: tmp/rubocop | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Prepare RuboCop cache | |
| uses: actions/cache@v5 | |
| env: | |
| DEPENDENCIES_HASH: ${{ hashFiles('.ruby-version', '**/.rubocop.yml', '**/.rubocop_todo.yml', 'Gemfile.lock') }} | |
| with: | |
| path: ${{ env.RUBOCOP_CACHE_ROOT }} | |
| key: rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}-${{ github.ref_name == github.event.repository.default_branch && github.run_id || 'default' }} | |
| restore-keys: | | |
| rubocop-${{ runner.os }}-${{ env.DEPENDENCIES_HASH }}- | |
| - name: Lint code for consistent style | |
| run: bin/rubocop -f github | |
| test: | |
| runs-on: ubuntu-latest | |
| # services: | |
| # redis: | |
| # image: valkey/valkey:8 | |
| # ports: | |
| # - 6379:6379 | |
| # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - name: Install packages | |
| run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libvips | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Run tests | |
| env: | |
| RAILS_ENV: test | |
| # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
| # REDIS_URL: redis://localhost:6379/0 | |
| run: bin/rails db:test:prepare test | |
| system-test: | |
| runs-on: ubuntu-latest | |
| # services: | |
| # redis: | |
| # image: valkey/valkey:8 | |
| # ports: | |
| # - 6379:6379 | |
| # options: --health-cmd "redis-cli ping" --health-interval 10s --health-timeout 5s --health-retries 5 | |
| steps: | |
| - name: Install packages | |
| run: sudo apt-get update && sudo apt-get install --no-install-recommends -y libvips | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Run System Tests | |
| env: | |
| RAILS_ENV: test | |
| # RAILS_MASTER_KEY: ${{ secrets.RAILS_MASTER_KEY }} | |
| # REDIS_URL: redis://localhost:6379/0 | |
| run: bin/rails db:test:prepare test:system | |
| - name: Keep screenshots from failed system tests | |
| uses: actions/upload-artifact@v7 | |
| if: failure() | |
| with: | |
| name: screenshots | |
| path: ${{ github.workspace }}/tmp/screenshots | |
| if-no-files-found: ignore | |
| docker-dev: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Seed korkban.yml from example | |
| run: cp config/korkban.example.yml config/korkban.yml | |
| - name: Build dev image and start stack | |
| run: docker compose up -d --build app | |
| - name: Wait for dev app to respond | |
| run: | | |
| for i in $(seq 1 60); do | |
| if docker compose exec -T app curl -fsS -o /dev/null http://localhost:3000/login; then | |
| echo "Dev app responded after ${i} attempts" | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "Dev app did not respond within timeout" | |
| docker compose ps | |
| docker compose logs app | |
| exit 1 | |
| - name: Tear down dev stack | |
| if: always() | |
| run: docker compose down -v | |
| docker-prod: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Seed .env from example | |
| run: cp .env.example .env | |
| - name: Seed korkban.yml from example | |
| run: cp config/korkban.example.yml config/korkban.yml | |
| - name: Ensure storage dir is writable by container rails user (uid 1000) | |
| run: | | |
| mkdir -p storage | |
| sudo chown -R 1000:1000 storage | |
| - name: Build prod image and start app (skip caddy) | |
| run: docker compose -f docker-compose.prod.yml up -d --build app | |
| - name: Wait for prod app to respond | |
| run: | | |
| for i in $(seq 1 60); do | |
| if docker compose -f docker-compose.prod.yml exec -T app curl -fsS -o /dev/null http://localhost:3000/login; then | |
| echo "Prod app responded after ${i} attempts" | |
| exit 0 | |
| fi | |
| sleep 2 | |
| done | |
| echo "Prod app did not respond within timeout" | |
| docker compose -f docker-compose.prod.yml ps | |
| docker compose -f docker-compose.prod.yml logs app | |
| exit 1 | |
| - name: Tear down prod stack | |
| if: always() | |
| run: docker compose -f docker-compose.prod.yml down -v | |
| task-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v4 | |
| - name: Install Task | |
| uses: arduino/setup-task@v2 | |
| with: | |
| version: 3.x | |
| repo-token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Seed korkban.yml from example | |
| run: cp config/korkban.example.yml config/korkban.yml | |
| - name: Run task test | |
| run: task test | |
| - name: Dump container logs on failure | |
| if: failure() | |
| run: docker compose logs | |
| - name: Tear down stack | |
| if: always() | |
| run: docker compose down -v |