update before actions in scratch controller #800
Workflow file for this run
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: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - "**" | |
| permissions: | |
| contents: read | |
| env: | |
| BUNDLE_JOBS: '3' | |
| BUNDLE_RETRY: '3' | |
| PAGER: '' | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Ruby and bundle cache | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: .tool-versions | |
| bundler-cache: true | |
| cache-version: 1 | |
| - name: Run RuboCop | |
| run: bundle exec rubocop --format progress | |
| test: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 45 | |
| permissions: | |
| contents: read | |
| issues: write | |
| pull-requests: write | |
| packages: read | |
| env: | |
| RAILS_ENV: test | |
| POSTGRES_DB: choco_cake_test | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_USER: choco | |
| POSTGRES_HOST: 127.0.0.1 | |
| POSTGRES_PORT: '5432' | |
| REDIS_URL: redis://127.0.0.1:6379/1 | |
| HOSTNAME: 127.0.0.1 | |
| ACTIVE_RECORD_ENCRYPTION_PRIMARY_KEY: primary-key | |
| ACTIVE_RECORD_ENCRYPTION_DETERMINISTIC_KEY: deterministic-key | |
| ACTIVE_RECORD_ENCRYPTION_KEY_DERIVATION_SALT: derivation-salt | |
| EDITOR_ENCRYPTION_KEY: a1b2c3d4e5f67890123456789abcdef0123456789abcdef0123456789abcdef0 | |
| SALESFORCE_CONNECT_HOST: 127.0.0.1 | |
| SALESFORCE_CONNECT_PORT: '4101' | |
| SALESFORCE_CONNECT_USER: postgres | |
| SALESFORCE_CONNECT_PASSWORD: password | |
| SALESFORCE_CONNECT_DB: salesforce_test | |
| services: | |
| postgres: | |
| image: postgres:12 | |
| env: | |
| POSTGRES_DB: choco_cake_test | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_USER: choco | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U choco -d choco_cake_test" | |
| --health-interval=10s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| redis: | |
| image: redis:6.2-alpine | |
| ports: | |
| - 6379:6379 | |
| salesforce_connect: | |
| image: 'ghcr.io/raspberrypifoundation/heroku-connect' | |
| credentials: | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| env: | |
| POSTGRES_DB: salesforce_test | |
| POSTGRES_PASSWORD: password | |
| POSTGRES_USER: postgres | |
| ports: | |
| - 4101:5432 | |
| options: >- | |
| --health-cmd="pg_isready -h 127.0.0.1 -U postgres" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=5 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install test dependencies | |
| run: > | |
| sudo apt-get update && sudo apt-get install --yes --no-install-recommends | |
| libvips | |
| - name: Set up Firefox | |
| uses: browser-actions/setup-firefox@v1 | |
| - name: Set up Ruby and bundle cache | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: .tool-versions | |
| bundler-cache: true | |
| cache-version: 1 | |
| - name: Verify Firefox availability | |
| run: firefox --version | |
| - name: Wait for DB | |
| run: | | |
| until pg_isready -h "$POSTGRES_HOST" -p "$POSTGRES_PORT" -U "$POSTGRES_USER"; do | |
| sleep 1 | |
| done | |
| - name: Database setup | |
| run: bin/rails db:setup --trace | |
| - name: Run test suite | |
| run: bundle exec rspec | |
| - name: Upload coverage artifact | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage | |
| if-no-files-found: ignore | |
| - name: Build coverage comment | |
| if: always() && github.event_name == 'pull_request' | |
| id: coverage_comment | |
| run: .github/scripts/build_coverage_comment.sh | |
| - name: Comment coverage on PR | |
| if: always() && github.event_name == 'pull_request' | |
| continue-on-error: true | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| COVERAGE_MESSAGE: ${{ steps.coverage_comment.outputs.message }} | |
| run: .github/scripts/post_coverage_comment.sh |