yagihiro/manga-tools

View on GitHub
.github/workflows/ruby.yml

Summary

Maintainability
Test Coverage
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

name: Ruby

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

jobs:
  test:
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu, macos]
        ruby: [2.6, 2.7]
    runs-on: ${{ matrix.os }}-latest
    steps:
    - uses: actions/checkout@v2
    - uses: ruby/setup-ruby@v1
      with:
        ruby-version: ${{ matrix.ruby }}
    - name: Setup Code Climate test-reporter
      if: ${{ matrix.os == 'ubuntu' && matrix.ruby == '2.6' }}
      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
    - run: bundle install --jobs 4 --retry 3
    - run: bundle exec rake
    - name: Publish code coverage
      if: ${{ matrix.os == 'ubuntu' && matrix.ruby == '2.6' }}
      run: |
        export GIT_BRANCH="${GITHUB_REF/refs\/heads\//}"
        ./cc-test-reporter after-build -r ${{secrets.CC_TEST_REPORTER_ID}}