gauravtiwari/ruby_graphiql_explorer

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
name: Rspec
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v1
      - name: Install Ruby (2.6)
        uses: actions/setup-ruby@v1
        with:
          ruby-version: 2.6.x
      - name: Cache Ruby gems
        uses: actions/cache@v2
        with:
          path: vendor/bundle
          key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
          restore-keys: |
            ${{ runner.os }}-gems-
      - name: Setup Code Climate test-reporter
        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
      - name: Bundle and test with RSpec
        run: |
          gem install bundler
          bundle config path vendor/bundle
          bundle install --jobs 4 --retry 3
          bundle exec rspec
      - name: Publish code coverage
        run: |
          export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
          ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}} -t simplecov