From f790800fffad19bd4312466c7b1599a4c7011768 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 4 Jul 2024 10:23:17 -0400 Subject: [PATCH 1/3] Add cache for rspec persistence file --- .github/workflows/test-ruby.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml index fcfeed5fbad..0e75a67b783 100644 --- a/.github/workflows/test-ruby.yml +++ b/.github/workflows/test-ruby.yml @@ -137,6 +137,18 @@ jobs: bin/rails db:setup bin/flatware fan bin/rails db:test:prepare + - name: Cache RSpec persistence file + uses: actions/cache@v4 + with: + path: | + tmp/rspec/examples.txt + key: rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }} + restore-keys: | + rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }} + rspec-persistence-${{ github.head_ref || github.ref_name }} + rspec-persistence-main + rspec-persistence + - run: bin/flatware rspec -r ./spec/flatware_helper.rb - name: Upload coverage reports to Codecov From d2d939d379964b0d3bbca2267892ecc881af9e69 Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 18 Jul 2024 13:56:09 -0400 Subject: [PATCH 2/3] Only cache on latest ruby version run? --- .github/workflows/test-ruby.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml index 0e75a67b783..5d3186ae06e 100644 --- a/.github/workflows/test-ruby.yml +++ b/.github/workflows/test-ruby.yml @@ -138,6 +138,7 @@ jobs: bin/flatware fan bin/rails db:test:prepare - name: Cache RSpec persistence file + if: matrix.ruby-version == '.ruby-version' uses: actions/cache@v4 with: path: | From 9c8809c90c2d6888b1befcec345c1901876bae1b Mon Sep 17 00:00:00 2001 From: Matt Jankowski Date: Thu, 25 Jul 2024 11:49:18 -0400 Subject: [PATCH 3/3] Cache per ruby version, but restore from all via keys --- .github/workflows/test-ruby.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-ruby.yml b/.github/workflows/test-ruby.yml index 5d3186ae06e..2801de2bacc 100644 --- a/.github/workflows/test-ruby.yml +++ b/.github/workflows/test-ruby.yml @@ -138,13 +138,13 @@ jobs: bin/flatware fan bin/rails db:test:prepare - name: Cache RSpec persistence file - if: matrix.ruby-version == '.ruby-version' uses: actions/cache@v4 with: path: | tmp/rspec/examples.txt key: rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }} restore-keys: | + rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }}-${{ matrix.ruby-version }} rspec-persistence-${{ github.head_ref || github.ref_name }}-${{ github.sha }} rspec-persistence-${{ github.head_ref || github.ref_name }} rspec-persistence-main