From 22fe544f6a5b3b9d3317ed323b16dd9e95b698ae Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Mon, 26 Oct 2026 13:00:48 -0600 Subject: [PATCH 1/2] Speed up Primer compatibility CI without reducing coverage --- .github/workflows/ci.yml | 54 +++++++++++++++++++++++++++++++++------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22b8c5b87..b72f7cc06 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -107,8 +107,34 @@ jobs: include-hidden-files: true primer_view_components_compatibility: name: Test compatibility with Primer ViewComponents (main) + if: always() + needs: primer_view_components_tests runs-on: ubuntu-latest steps: + - name: Check compatibility results + env: + RESULT: ${{ needs.primer_view_components_tests.result }} + run: test "$RESULT" = success + primer_view_components_tests: + name: Primer ViewComponents (${{ matrix.suite }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - suite: Ruby + tasks: test:components test:lib test:performance + - suite: System + tasks: test:system + - suite: Accessibility + tasks: test:accessibility + defaults: + run: + working-directory: primer_view_components + env: + VIEW_COMPONENT_PATH: ../view_component + RAILS_VERSION: '8.1.0' + steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with: repository: 'primer/view_components' @@ -120,26 +146,36 @@ jobs: path: 'view_component' persist-credentials: false - name: Setup Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 4.0 + working-directory: 'primer_view_components' + - name: Resolve Primer dependencies against this checkout + run: bundle lock + - name: Cache Ruby gems uses: ruby/setup-ruby@v1 with: ruby-version: 4.0 bundler-cache: true - working-directory: 'view_component' + working-directory: 'primer_view_components' - uses: actions/setup-node@v5 with: node-version: 22 cache: 'npm' - cache-dependency-path: 'primer_view_components/package-lock.json' - - name: Build and test with Rake + cache-dependency-path: | + primer_view_components/package-lock.json + primer_view_components/demo/package-lock.json + - name: Install JavaScript dependencies run: | - cd primer_view_components npm ci - cd demo && npm ci && cd .. - bundle --quiet && bundle exec rake + npm ci --prefix demo + - name: Test with Rake + shell: bash env: - VIEW_COMPONENT_PATH: ../view_component - RAILS_VERSION: '8.1.0' - PARALLEL_WORKERS: '1' + RAKE_TASKS: ${{ matrix.tasks }} + run: | + read -r -a tasks <<< "$RAKE_TASKS" + bundle exec rake "${tasks[@]}" coverage: needs: test runs-on: ubuntu-latest From 022232c86624c761c4a451c8de5b1fe1fe36f3cd Mon Sep 17 00:00:00 2001 From: Joel Hawksley Date: Mon, 26 Oct 2026 13:04:32 -0600 Subject: [PATCH 2/2] Pin actions in Primer compatibility jobs --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b72f7cc06..ffceb6f4f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,19 +146,19 @@ jobs: path: 'view_component' persist-credentials: false - name: Setup Ruby - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1 with: ruby-version: 4.0 working-directory: 'primer_view_components' - name: Resolve Primer dependencies against this checkout run: bundle lock - name: Cache Ruby gems - uses: ruby/setup-ruby@v1 + uses: ruby/setup-ruby@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1 with: ruby-version: 4.0 bundler-cache: true working-directory: 'primer_view_components' - - uses: actions/setup-node@v5 + - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 with: node-version: 22 cache: 'npm'