Bump trilogy from 2.11.1 to 2.12.2 #1013
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: Run Test Suite | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| - v0.1 | |
| - v0.2 | |
| - v0.3 | |
| - v-0-4-stable | |
| - v-0-5-stable | |
| - v-0-6-stable | |
| - v-0-7-stable | |
| - v-0-8-stable | |
| - v-0-9-stable | |
| - v-0-10-stable | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '**' | |
| jobs: | |
| export_variables: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| app_image: ${{ steps.compute_container_registry_name.outputs.CR_NAME }}/app:${{ steps.read_app_image_tag.outputs.APP_IMAGE_TAG }} | |
| primary_image: ${{ steps.compute_container_registry_name.outputs.CR_NAME }}/postgres_primary:${{ steps.calculate_primary_sha.outputs.PRIMARY_SHA }} | |
| replica_image: ${{ steps.compute_container_registry_name.outputs.CR_NAME }}/postgres_replica:${{ steps.calculate_replica_sha.outputs.REPLICA_SHA }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Compute container registry name | |
| id: compute_container_registry_name | |
| run: echo "CR_NAME=$(echo ghcr.io/${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT | |
| - name: Read app image tag | |
| id: read_app_image_tag | |
| run: echo "APP_IMAGE_TAG=$(head -n1 .app-image-tag)" >> $GITHUB_OUTPUT | |
| - name: Calculate SHA256 for docker/postgres_primary/Dockerfile | |
| id: calculate_primary_sha | |
| run: echo "PRIMARY_SHA=$(sha256sum docker/postgres_primary/Dockerfile | awk '{ print substr($1, 1, 12) }')" >> $GITHUB_OUTPUT | |
| - name: Calculate SHA256 for docker/postgres_replica/Dockerfile | |
| id: calculate_replica_sha | |
| run: | | |
| checksum () { | |
| sha256sum $@ | awk '{print substr($1, 1, 12)}' | |
| } | |
| REPLICA_DOCKERFILE_SHA=$(checksum docker/postgres_replica/Dockerfile) | |
| REPLICA_CMD_SHA=$(checksum docker/postgres_replica/start_server) | |
| echo "REPLICA_SHA=$(echo \"${REPLICA_DOCKERFILE_SHA}-${REPLICA_CMD_SHA}\" | checksum)" >> $GITHUB_OUTPUT | |
| rubocop: | |
| runs-on: ubuntu-latest | |
| needs: [export_variables] | |
| container: | |
| image: ${{ needs.export_variables.outputs.app_image }}-4.0.2 | |
| volumes: | |
| - .:/app | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Run RuboCop | |
| run: bundle exec rubocop | |
| rspec: | |
| needs: [export_variables] | |
| runs-on: ubuntu-latest | |
| container: | |
| image: ${{ needs.export_variables.outputs.app_image }}-${{ matrix.ruby }} | |
| volumes: | |
| - .:/app | |
| env: | |
| RAILS_ENV: test | |
| PG_PRIMARY_USER: postgres_primary_test | |
| PG_PRIMARY_PASSWORD: postgres_primary_test | |
| PG_PRIMARY_HOST: postgres_primary | |
| PG_PRIMARY_PORT: 5432 | |
| PG_REPLICA_USER: postgres_primary_test | |
| PG_REPLICA_PASSWORD: postgres_primary_test | |
| PG_REPLICA_HOST: postgres_replica | |
| PG_REPLICA_PORT: 5432 | |
| MYSQL_PRIMARY_USER: root | |
| MYSQL_PRIMARY_PASSWORD: root | |
| MYSQL_PRIMARY_HOST: mysql | |
| MYSQL_PRIMARY_PORT: 3306 | |
| MYSQL_REPLICA_USER: root | |
| MYSQL_REPLICA_PASSWORD: root | |
| MYSQL_REPLICA_HOST: mysql | |
| MYSQL_REPLICA_PORT: 3306 | |
| BUNDLE_GEMFILE: gemfiles/ar_${{ matrix.ar }}.gemfile | |
| RUBY_VERSION: ${{ matrix.ruby }} | |
| RAILS_VERSION: ${{ matrix.ar }} | |
| strategy: | |
| matrix: | |
| ruby: | |
| - "3.2.11" | |
| - "3.3.11" | |
| - "3.4.9" | |
| - "4.0.2" | |
| ar: | |
| - "7.2" | |
| - "8.0" | |
| - "8.1" | |
| name: Ruby ${{ matrix.ruby }} / ActiveRecord ${{ matrix.ar }} | |
| services: | |
| postgres_primary: | |
| image: ${{ needs.export_variables.outputs.primary_image }} | |
| env: | |
| POSTGRES_DB: postgres_primary_test | |
| POSTGRES_USER: postgres_primary_test | |
| POSTGRES_PASSWORD: postgres_primary_test | |
| POSTGRES_HOST_AUTH_METHOD: "scram-sha-256\nhost replication all 0.0.0.0/0 md5" | |
| POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256" | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| postgres_replica: | |
| image: ${{ needs.export_variables.outputs.replica_image }} | |
| env: | |
| PGUSER: replicator | |
| PGPASSWORD: replicator | |
| PGPORT: 5432 | |
| PRIMARY_DATABASE_HOST: postgres_primary | |
| PRIMARY_DATABASE_PORT: 5432 | |
| options: >- | |
| --health-cmd pg_isready | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| mysql: | |
| image: mariadb:11.4 | |
| env: | |
| MARIADB_HOST: mysql | |
| MARIADB_DATABASE: mysql | |
| MARIADB_ROOT_PASSWORD: root | |
| options: >- | |
| --health-cmd "mariadb-admin ping" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| - name: Setup database | |
| run: bundle exec rake db:setup | |
| - name: Run RSpec tests | |
| run: bundle exec rspec --format progress --tag ~integration | |
| - name: Run RSpec integration tests | |
| env: | |
| PG_REPLICA_HOST: postgres_primary | |
| PG_REPLICA_PORT: 5432 | |
| run: bundle exec rspec --format progress --tag integration | |
| - name: Upload Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage_ruby_${{ matrix.ruby }}_ar_${{ matrix.ar }} | |
| path: coverage/ | |
| include-hidden-files: true | |
| if-no-files-found: error | |
| coverage_report: | |
| needs: | |
| - export_variables | |
| - rspec | |
| runs-on: ubuntu-latest | |
| permissions: write-all | |
| container: | |
| image: ${{ needs.export_variables.outputs.app_image }}-4.0.2 | |
| volumes: | |
| - .:/app | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v6 | |
| - name: Download Partial Coverage Resultsets | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: coverage/ | |
| - name: Collate Partial Coverage Resultsets | |
| run: bundle exec rake coverage:report | |
| - name: Upload Full Coverage Report | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage | |
| path: coverage/ | |
| include-hidden-files: true | |
| if-no-files-found: error | |
| - uses: joshmfrankel/simplecov-check-action@main | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} |