name: CI - develop on: push: branches-ignore: - master jobs: rspec: name: RSpec - ${{ matrix.title }} runs-on: ubuntu-latest strategy: fail-fast: false matrix: checkout: [branch, master] include: - checkout: branch ref: null title: current branch rebase: false codeclimate: true - checkout: master ref: master title: merge with master rebase: true codeclimate: false services: postgres: options: >- --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 image: postgres:10.10 ports: - 5432:5432 env: POSTGRES_DB: arel_toolkit_test POSTGRES_USER: postgres steps: - uses: actions/checkout@v1 with: ref: ${{ matrix.ref }} # Based on # https://discourse.drone.io/t/planned-change-to-git-clone-logic/1165 - name: Rebase if: matrix.rebase run: | git config --global user.email "ci@github.com" git config --global user.name "GitHub CI" git fetch origin $GITHUB_REF git rebase $GITHUB_SHA - name: Set up Ruby 2.5.x uses: actions/setup-ruby@v1 with: ruby-version: 2.5.x - name: Setup run: | curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter chmod +x ./cc-test-reporter ./cc-test-reporter before-build sudo apt-get install -y libpq-dev gem install bundler bundle install --jobs 4 --retry 3 bundle exec appraisal install bundle exec rake clean bundle exec rake compile - name: RSpec run: | bundle exec appraisal rspec --force-color - name: Report to codeclimate if: always() && matrix.codeclimate shell: bash env: JOB_STATUS: ${{ job.status == 'Success' }} CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} run: | EXIT_CODE=$([[ "$JOB_STATUS" == true ]] && echo 0 || echo 1) ./cc-test-reporter after-build --exit-code $EXIT_CODE