From 3cc0bf7eab3093b596894ec3ee2a3768f43a1dfc Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Mon, 19 Aug 2024 09:22:35 +0200 Subject: [PATCH] CI: rely on ruby/setup-ruby to bundle install ruby/setup-ruby, enable Bundler cache Set env vars, at a higher level in the configuration. --- .github/workflows/ci.yml | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc9499c..3a89f7e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,8 +4,11 @@ on: [push, pull_request] jobs: test: + env: + RAILS_VERSION: ${{ matrix.rails }} + BUNDLE_PATH: "vendor/bundle-${{ matrix.rails }}" runs-on: ubuntu-latest - name: Test against Rails ${{ matrix.rails }} with Ruby ${{ matrix.ruby }} + name: Test against Rails ${{ matrix.rails }} on Ruby ${{ matrix.ruby }} strategy: matrix: rails: [ @@ -30,26 +33,20 @@ jobs: ruby: '3.2' steps: - - uses: actions/checkout@v3 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: false - + - uses: actions/checkout@v4 - name: Install Dependencies - env: - RAILS_VERSION: ${{ matrix.rails }} - BUNDLE_PATH: "vendor/bundle-${{ matrix.rails }}" run: | sudo apt-get update sudo apt-get -yqq install libsqlite3-dev chromium-browser - bundle install --jobs 4 --retry 3 + + - uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + bundler-cache: true - name: Test run: bundle exec rake env: - RAILS_VERSION: ${{ matrix.rails }} - BUNDLE_PATH: "vendor/bundle-${{ matrix.rails }}" DEFAULT_TEST_EXCLUDE: "" RAILS_ENV: "test"