paolobrasolin/antex

View on GitHub
.github/workflows/main.yml

Summary

Maintainability
Test Coverage
name: CI

on:
  push:
  pull_request:

jobs:
  main:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: ["ubuntu-latest"]
        ruby: ["2.6", "2.7", "3.0", "3.1", "3.2"]
        include:
          - os: ubuntu-latest
            ruby: "2.7"
            coverage: true
    env:
      BUNDLE_WITHOUT: development

    steps:
      - name: Checkout repo
        uses: actions/checkout@v3

      - name: Setup Ruby
        uses: ./.github/actions/setup-ruby
        with:
          ruby-version: ${{ matrix.ruby }}
          bundler-cache: true

      - name: Setup TeX Live
        uses: paolobrasolin/setup-texlive-action@main
        with:
          cache-key: texlive-${{ matrix.os }}
          packages-path: ${{ github.workspace }}/.github/texlive.packages
          profile-path: ${{ github.workspace }}/.github/texlive.profile

      - name: Run tests
        run: bundle exec rspec

      - name: Test and publish coverage to Code Climate
        uses: paambaati/codeclimate-action@v3.0.0
        if: ${{ matrix.coverage && github.ref == 'refs/heads/main' }}
        env:
          CC_TEST_REPORTER_ID: 072f27048cd818ab695de7b632d607a6275a8dbebea03fd155fa7de0362be129
        with:
          coverageCommand: bundle exec rspec
          coverageLocations: ${{ github.workspace }}/coverage/coverage.json:simplecov