From 60a80c716cbb19a363489481a2d8ce724e41cec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20=E2=9A=9B=20Stegman?= Date: Fri, 5 Jan 2024 15:08:17 -0600 Subject: [PATCH] Set up a build matrix (#5) * Update GH actions * Use upstream GH actions config Updated with details specific to this project, like coverage --- .github/workflows/main.yaml | 55 ++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 32 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index 8e55deb..d8dbbd6 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,41 +1,32 @@ -name: Main +name: CI on: [push] jobs: - vm-job: + build: runs-on: ubuntu-latest - - # https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobsjob_idstrategymatrix strategy: fail-fast: false + matrix: + ruby-version: + - '3.0' + - '3.1' + - '3.2' + - '3.3' + - head steps: - - uses: actions/checkout@v2 - - - name: Set up Ruby - uses: actions/setup-ruby@v1 - with: - ruby-version: '2.6' - - - uses: actions/cache@v1 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: Bundle Install - run: | - gem install bundler -v '1.17.3' - bundle install --jobs 4 --retry 3 - - - name: Run tests - run: | - COVERAGE=true bundle exec rspec - - name: Upload coverage results - uses: actions/upload-artifact@master - if: always() - with: - name: coverage-report - path: coverage + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Run tests + run: COVERAGE=true bundle exec rspec + - name: Upload coverage results + uses: actions/upload-artifact@v4 + if: always() + with: + name: coverage-report-ruby-${{ matrix.ruby-version }} + path: coverage