From 437a444fb113dc553d39009548adfc48faac3d8e Mon Sep 17 00:00:00 2001 From: Matt Polito Date: Tue, 23 May 2023 12:01:03 -0400 Subject: [PATCH] Coveralls setup with Github actions --- .github/workflows/ci.yml | 47 +++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 262d3cb..8888924 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,28 +2,55 @@ name: CI on: push: - branches: [master] + branches: + - master pull_request: - branches: [master] + branches: + - '*' jobs: - test: - runs-on: ubuntu-latest + build: + name: Ruby ${{ matrix.ruby }} strategy: + fail-fast: true matrix: - ruby-version: + ruby: - '3.2' - '3.1' - '3.0' - 'jruby-head' + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v3 - - name: Set up Ruby ${{ matrix.ruby-version }} + - name: Checkout + uses: actions/checkout@v3 + + - name: Install Ruby ${{ matrix.ruby }} uses: ruby/setup-ruby@v1 with: - ruby-version: ${{ matrix.ruby-version }} - bundler-cache: true # runs 'bundle install' and caches installed gems automatically + ruby-version: ${{ matrix.ruby }} + bundler-cache: true # 'bundle install' and cache + - name: Run tests - run: bundle exec rake + run: bundle exec rake --trace + continue-on-error: false + + - name: Report coverage + uses: coverallsapp/github-action@v2 + with: + flag-name: ruby-${{ matrix.ruby }} + parallel: true + + coveralls-done: + if: always() + name: Finish coverage reporting + runs-on: ubuntu-latest + needs: build + steps: + - name: Coveralls done + uses: coverallsapp/github-action@v2 + with: + parallel-finished: true + carryforward: 'ruby-3.2,ruby-3.1,ruby-3.0'