From 8b7090cfd426f3fe6efad72c6c17485738deaa2e Mon Sep 17 00:00:00 2001 From: Leon Berenschot Date: Fri, 8 Dec 2023 20:25:06 +0100 Subject: [PATCH] update workflow to run tests w/ appraisals --- .github/workflows/ruby.yml | 106 +++++++++++++++++++++++++++++-------- 1 file changed, 84 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 2012e7f..be36ebb 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -18,31 +18,75 @@ permissions: jobs: test: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest + name: Ruby ${{ matrix.ruby }} w/ ${{ matrix.gemfile }} strategy: fail-fast: false matrix: - ruby: [2.3, 2.4, 2.5, 2.6, 2.7] - rails: ["4.1", "4.2", "5.0", "5.2.3", "6.0"] - exclude: - - ruby: "2.4" - rails: "4.1" - - ruby: "2.4" - rails: "4.2" - - ruby: "2.4" - rails: "6.0" - - ruby: "2.5" - rails: "4.1" - - ruby: "2.5" - rails: "4.2" - - ruby: "2.6" - rails: "4.1" - - ruby: "2.6" - rails: "4.2" - - ruby: "2.7" - rails: "4.1" - - ruby: "2.7" - rails: "4.2" + ruby: + - "2.3" + - "2.4" + - "2.5" + - "2.6" + - "2.7" + - "3.0" + - "3.1" + # - "3.2" + gemfile: + - "activesupport-3.2" + - "activesupport-4.0" + - "activesupport-4.1" + - "activesupport-4.2" + - "activesupport-5.0" + - "activesupport-5.1" + - "activesupport-5.2" + - "activesupport-6.0" + - "activesupport-6.1" + - "activesupport-7.0" + - "activesupport-7.1" + # exclude: + # - ruby: "2.4" + # gemfile: "activesupport-4.1" + # - ruby: "2.4" + # gemfile: "activesupport-4.2" + # - ruby: "2.4" + # gemfile: "activesupport-5.0" + # - ruby: "2.4" + # gemfile: "activesupport-5.1" + # - ruby: "2.4" + # gemfile: "activesupport-6.0" + + # - ruby: "2.5" + # gemfile: "activesupport-4.1" + # - ruby: "2.5" + # gemfile: "activesupport-4.2" + # - ruby: "2.5" + # gemfile: "activesupport-5.0" + # - ruby: "2.5" + # gemfile: "activesupport-5.1" + # - ruby: "2.5" + # gemfile: "activesupport-5.2" + + # - ruby: "2.6" + # gemfile: "activesupport-4.1" + # - ruby: "2.6" + # gemfile: "activesupport-4.2" + # - ruby: "2.6" + # gemfile: "activesupport-5.0" + # - ruby: "2.6" + # gemfile: "activesupport-5.1" + # - ruby: "2.6" + # gemfile: "activesupport-5.2" + # - ruby: "2.6" + # gemfile: "activesupport-6.0" + # - ruby: "2.6" + # gemfile: "activesupport-7.0" + # - ruby: "2.6" + # gemfile: "activesupport-7.1" + # - ruby: "2.7" + # gemfile: "activesupport-4.1" + # - ruby: "2.7" + # gemfile: "activesupport-4.2" steps: - uses: actions/checkout@v4 - name: Set up Ruby @@ -50,5 +94,23 @@ jobs: with: ruby-version: ${{ matrix.ruby }} bundler-cache: true # runs 'bundle install' and caches installed gems automatically + - name: Configure bundler + run: | + bundle config path vendor/bundle + - name: Create bundler lockfile + run: | + bundle lock + - uses: actions/cache@v3 + with: + # NOTE: Bundler expands the path relative to the gemfile, not the + # current directory. + path: ./gemfiles/vendor/bundle + key: bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles( 'gemfiles/*.lock' ) }} + restore-keys: | + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}-${{ matrix.gemfile }}- + bundled-gems-${{ runner.os }}-ruby-${{ matrix.ruby }}- + - name: Install gems + run: | + bundle install --jobs 4 - name: Run tests run: bundle exec rake