From 7e65f6880fc7f06d1f4e23ab8b31a4055e4944b7 Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Sun, 17 Dec 2023 11:26:38 +0000 Subject: [PATCH 1/7] Defer to built-in action caching Closes #1937 --- .github/workflows/ci.yml | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4123f766..80eba72f7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,14 +15,9 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 3.3 - - uses: actions/cache@v4 - with: - path: vendor/bundle - key: gems-build-rails-main-ruby-3.3-${{ hashFiles('**/Gemfile.lock') }} + bundler-cache: true - name: Run benchmarks run: | - bundle config path vendor/bundle - bundle update bundle exec rake partial_benchmark bundle exec rake translatable_benchmark test: @@ -104,22 +99,16 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 3.2 + bundler-cache: true - uses: actions/setup-node@v4 with: node-version: 16 - - uses: actions/cache@v4 - with: - path: | - node_modules - vendor/bundle - key: gems-build-pvc-${{ hashFiles('**/Gemfile.lock') }}-${{ hashFiles('**/package-json.lock') }} + cache: 'npm' - name: Build and test with Rake run: | cd primer_view_components npm ci cd demo && npm ci && cd .. - bundle config path vendor/bundle - bundle install bundle exec rake env: VIEW_COMPONENT_PATH: ../view_component @@ -134,16 +123,11 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 3.3 + bundler-cache: true - name: Download coverage results uses: actions/download-artifact@v3 - - uses: actions/cache@v4 - with: - path: vendor/bundle - key: gems-build-rails-main-ruby-3.3-${{ hashFiles('**/Gemfile.lock') }} - name: Collate simplecov run: | - bundle config path vendor/bundle - bundle update bundle exec rake coverage:report env: RAILS_VERSION: '~> 7.1.0' From 81bd18ae45aa9e67c0e3469c8620343892b9cf6b Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Sun, 17 Dec 2023 11:33:55 +0000 Subject: [PATCH 2/7] Lookup PVC package-lock --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 80eba72f7..673d9c08c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,6 +104,7 @@ jobs: with: node-version: 16 cache: 'npm' + cache-dependency-path: 'primer_view_components/package-lock.json' - name: Build and test with Rake run: | cd primer_view_components From 9d957f7d087c2ddade0ac94f488213309803c652 Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Sun, 17 Dec 2023 11:36:34 +0000 Subject: [PATCH 3/7] Setup Ruby in view_component directory --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 673d9c08c..439500d6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -100,6 +100,7 @@ jobs: with: ruby-version: 3.2 bundler-cache: true + working-directory: 'view_component' - uses: actions/setup-node@v4 with: node-version: 16 From 986d037f1c5890c2b14169a8e27ad8137f849c49 Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Sun, 17 Dec 2023 11:40:02 +0000 Subject: [PATCH 4/7] Manually bundle check again before we run rake --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 439500d6f..5df444fb2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -111,7 +111,7 @@ jobs: cd primer_view_components npm ci cd demo && npm ci && cd .. - bundle exec rake + bundle && bundle exec rake env: VIEW_COMPONENT_PATH: ../view_component RAILS_VERSION: '7.1.1' From bbf119cbe3ac23d74cb8dea29a87ecf9274362ea Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Sat, 17 Aug 2024 10:10:39 +0100 Subject: [PATCH 5/7] Update changelog --- docs/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 0291dc5de..dc03cd061 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -10,6 +10,10 @@ nav_order: 5 ## main +* Defer to built-in caching for language environment setup, rather than manually using `actions/cache` in CI. + + *Simon Fish* + * Add test coverage for use of `turbo_stream` helpers in components when `capture_compatibility_patch_enabled` is `true`. *Simon Fish* From 2fdd3091ca25630ddcedde5e2d6756ba9778cef6 Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Sat, 17 Aug 2024 10:13:45 +0100 Subject: [PATCH 6/7] Default to Ruby 3.3 for actions --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5df444fb2..4f790203c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,7 +98,7 @@ jobs: - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 3.2 + ruby-version: 3.3 bundler-cache: true working-directory: 'view_component' - uses: actions/setup-node@v4 From d6446e77aae190d7f44ef3393a75604c468c41b7 Mon Sep 17 00:00:00 2001 From: Simon Fish Date: Wed, 21 Aug 2024 09:26:51 +0100 Subject: [PATCH 7/7] Remove version constraint for coverage Uses the Rails version specified in Gemfile.lock. --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4f790203c..7530d0805 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,5 +131,3 @@ jobs: - name: Collate simplecov run: | bundle exec rake coverage:report - env: - RAILS_VERSION: '~> 7.1.0'