From ac36637f04e428f697a6ec20e4a3556e75b8358a Mon Sep 17 00:00:00 2001 From: Adam Stegman Date: Fri, 5 Jan 2024 20:34:43 +0000 Subject: [PATCH] Use upstream GH actions config Updated with details specific to this project, like coverage --- .github/workflows/main.yaml | 62 +++++++++++++++---------------------- 1 file changed, 25 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f47ac1e..e9315ed 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -1,47 +1,35 @@ -name: Main +name: CI -on: [push] +on: + - push + - pull_request 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.2' - - '3.3' + - 3.0 + - 3.1 + - 3.2 + - 3.3 - head steps: - - uses: actions/checkout@v4 - - - name: Set up Ruby - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby-version }} - - - uses: actions/cache@v3 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - - name: Bundle Install - run: | - gem install bundler - bundle install --jobs 4 --retry 3 - - - 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 + - uses: actions/checkout@v3 + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby-version }} + bundler-cache: true + - name: Run Rubocop + run: bundle exec rubocop + - 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