CI #346
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 | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| on: | |
| pull_request: | |
| branches: [ main, master ] | |
| schedule: | |
| - cron: '0 1 * * *' | |
| permissions: | |
| contents: read | |
| jobs: | |
| specs: | |
| timeout-minutes: 15 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 | |
| with: | |
| ruby-version: '4.0.5' | |
| bundler-cache: true | |
| - name: Set up Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install Node dependencies | |
| run: npm ci | |
| - name: Build Tailwind CSS | |
| run: bundle exec rails tailwindcss:build | |
| env: | |
| RAILS_ENV: test | |
| - name: Setup database | |
| run: bundle exec rails db:create db:schema:load | |
| env: | |
| RAILS_ENV: test | |
| - name: Run tests | |
| env: | |
| RAILS_ENV: test | |
| run: bundle exec rspec | |
| rubocop: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE_GEMFILE: Gemfile.lint | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 | |
| with: | |
| ruby-version: '4.0.5' | |
| bundler-cache: true | |
| - name: Run RuboCop | |
| run: bundle exec rubocop | |
| yard-lint: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| env: | |
| BUNDLE_GEMFILE: Gemfile.lint | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Ruby | |
| uses: ruby/setup-ruby@d45b1a4e94b71acab930e56e79c6aa188764e7f9 # v1.316.0 | |
| with: | |
| ruby-version: '4.0.5' | |
| bundler-cache: true | |
| - name: Run yard-lint | |
| run: bundle exec yard-lint app/ | |
| herb-lint: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run herb-lint | |
| run: npx herb-lint | |
| lostconf: | |
| timeout-minutes: 5 | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Run lostconf | |
| run: npx lostconf --fail-on-stale | |
| ci-success: | |
| name: CI Success | |
| runs-on: ubuntu-latest | |
| if: always() | |
| needs: | |
| - specs | |
| - rubocop | |
| - yard-lint | |
| - herb-lint | |
| - lostconf | |
| steps: | |
| - name: Check all jobs passed | |
| if: | | |
| contains(needs.*.result, 'failure') || | |
| contains(needs.*.result, 'cancelled') || | |
| contains(needs.*.result, 'skipped') | |
| run: exit 1 | |
| - run: echo "All CI checks passed!" |