Add script to fix which schools are attributed to BLMK and N&W #18960
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: Test | |
| on: | |
| pull_request: | |
| workflow_call: | |
| permissions: {} | |
| jobs: | |
| pre-rails-tests: | |
| name: Check if Rails tests need to run | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| - name: Determine if rails tests are needed | |
| id: check-rails-relevant-changes | |
| continue-on-error: true | |
| run: | | |
| if [ ${{ github.event_name }} == "pull_request" ]; then | |
| git fetch origin | |
| RELEVANT_DIRS=$(git diff origin/${{ github.event.pull_request.base.ref }}...HEAD --name-only) | |
| if [ -z "$(echo "$RELEVANT_DIRS" | egrep -v "^(.github|adr|aws|docs|storage|terraform)/")" ]; then | |
| echo "No relevant changes detected, skipping rails tests" | |
| echo "RUN_RAILS_TESTS=false" >> $GITHUB_ENV | |
| exit 0 | |
| fi | |
| fi | |
| echo "Not a pull request or detected relevant changes: Running rails tests" | |
| echo "RUN_RAILS_TESTS=true" >> $GITHUB_ENV | |
| - name: Run rails tests if diff check fails | |
| id: check-rails-relevant-changes-failure | |
| run: | | |
| if [[ ${{ steps.check-rails-relevant-changes.outcome }} == failure ]]; then | |
| echo "RUN_RAILS_TESTS=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "RUN_RAILS_TESTS=$RUN_RAILS_TESTS" >> $GITHUB_OUTPUT | |
| fi | |
| outputs: | |
| run-rails-tests: ${{ steps.check-rails-relevant-changes-failure.outputs.RUN_RAILS_TESTS }} | |
| rails: | |
| name: Rails | |
| runs-on: ubuntu-latest | |
| needs: pre-rails-tests | |
| if: needs.pre-rails-tests.outputs.run-rails-tests == 'true' | |
| services: | |
| postgres: | |
| image: postgres:17.2 | |
| env: | |
| POSTGRES_PASSWORD: postgres | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| ports: | |
| - 5432:5432 | |
| env: | |
| RAILS_ENV: test | |
| DATABASE_HOST: localhost | |
| DATABASE_USER: postgres | |
| DATABASE_PASSWORD: postgres | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| cache: yarn | |
| - uses: ruby/setup-ruby@v1 | |
| with: | |
| bundler-cache: true | |
| - name: Setup Database | |
| run: | | |
| bin/rails parallel:create | |
| bin/rails parallel:load_schema | |
| - name: Precompile assets | |
| run: bin/rails assets:precompile | |
| - name: Run rspec | |
| run: bin/rails parallel:spec | |
| jest: | |
| name: Jest | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .tool-versions | |
| cache: yarn | |
| - run: yarn install --immutable --immutable-cache --check-cache | |
| - run: yarn test | |
| terraform: | |
| name: Terraform Validate | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| working-directory: terraform | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: hashicorp/setup-terraform@v3 | |
| with: | |
| terraform_version: 1.13.3 | |
| - run: terraform init -backend=false | |
| - run: terraform validate |