mmcs-ruby/sentiment

View on GitHub
.github/workflows/ci.yml

Summary

Maintainability
Test Coverage
# This is a basic workflow to help you get started with Actions

name: Build

# Controls when the workflow will run
on: [push,pull_request, workflow_dispatch]
# Triggers the workflow on push or pull request events but only for the master branch
# *workflow_dispatch* Allows you to run this workflow manually from the Actions tab
  
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: ubuntu-latest
    env: 
      CC_TEST_REPORTER_ID: ${{ secrets.SECRET_CODECLIMATE_TOKEN}}
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
      # Runs a Ruby setup
    - name: Set up Ruby
      uses: ruby/setup-ruby@v1
      with:
        ruby-version: 2.7.2
        bundler-cache: true
    - name: Add codeclimate
      run: |
        curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
        chmod +x ./cc-test-reporter
    - name: Before-build Codeclimate
      run: ./cc-test-reporter before-build
    - uses: actions/cache@v2
      with:
        path: vendor/bundle
        key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
        restore-keys: |
          ${{ runner.os }}-gems-
    - name: Run the default task
      run: bundle exec rake
    - name: After-build Codeclimate
      run: ./cc-test-reporter after-build