rkrage/pg_party

View on GitHub
.circleci/config.yml

Summary

Maintainability
Test Coverage
shared_config: &shared_config
  machine:
    image: ubuntu-2004:202201-02

  steps:
    - checkout

    - run:
        name: Prepare and start containers
        command: docker-compose up -d

    - run:
        name: Install global gems
        command: bin/de bundle

    - run:
        name: Install appraisal gems
        command: bin/de appraisal

    - run:
        name: Notify CC that tests are about to run
        command: |
          set +e
          [ "$UPLOAD_COVERAGE" = "true" ] &&
          bin/de cc-reporter before-build
          /bin/true

    - run:
        name: Run tests
        command: bin/de appraisal rake ci

    - store_test_results:
        path: spec/results

    - store_artifacts:
        path: coverage

    - run:
        name: Attempting to upload coverage report
        when: always
        command: |
          set +e
          [ "$UPLOAD_COVERAGE" = "true" ] &&
          [ -d "coverage" ] &&
          bin/de cc-reporter after-build -t simplecov
          /bin/true

version: 2
jobs:
  build-ruby-3.0-pg-11:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: 3.0
      CONTAINER_PG_VERSION: 11

  build-ruby-3.0-pg-12:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: 3.0
      CONTAINER_PG_VERSION: 12

  build-ruby-3.0-pg-13:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: 3.0
      CONTAINER_PG_VERSION: 13

  build-ruby-3.0-pg-14:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: 3.0
      CONTAINER_PG_VERSION: 14

  build-ruby-3.0-pg-15:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: 3.0
      CONTAINER_PG_VERSION: 15

  build-ruby-3.0-pg-16:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: 3.0
      CONTAINER_PG_VERSION: 15
      UPLOAD_COVERAGE: true

  build-ruby-latest-pg-11:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: latest
      CONTAINER_PG_VERSION: 11

  build-ruby-latest-pg-12:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: latest
      CONTAINER_PG_VERSION: 12

  build-ruby-latest-pg-13:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: latest
      CONTAINER_PG_VERSION: 13

  build-ruby-latest-pg-14:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: latest
      CONTAINER_PG_VERSION: 14

  build-ruby-latest-pg-15:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: latest
      CONTAINER_PG_VERSION: 15

  build-ruby-latest-pg-16:
    <<: *shared_config

    environment:
      CONTAINER_RUBY_VERSION: latest
      CONTAINER_PG_VERSION: 16

workflows:
  version: 2
  build_matrix:
    jobs:
      - build-ruby-3.0-pg-11
      - build-ruby-3.0-pg-12
      - build-ruby-3.0-pg-13
      - build-ruby-3.0-pg-14
      - build-ruby-3.0-pg-15
      - build-ruby-3.0-pg-16
      - build-ruby-latest-pg-11
      - build-ruby-latest-pg-12
      - build-ruby-latest-pg-13
      - build-ruby-latest-pg-14
      - build-ruby-latest-pg-15
      - build-ruby-latest-pg-16