Repository navigation
Fix unresolvable interpolated render dependencies #9305
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| permissions: | |
| contents: read | |
| actions: read | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - main | |
| jobs: | |
| benchmark: | |
| if: always() | |
| needs: benchmark-rails | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check benchmark results | |
| env: | |
| RESULT: ${{ needs.benchmark-rails.result }} | |
| run: test "$RESULT" = success || test "$RESULT" = skipped | |
| benchmark-rails: | |
| name: benchmark (Rails ${{ matrix.rails_version }}) | |
| if: github.event_name == 'pull_request' | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| rails_version: ["8.1", "main"] | |
| env: | |
| BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| ref: ${{ github.event.pull_request.base.sha }} | |
| path: tmp/base | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@26e5b7d197ebf60545ee9667bcbace0be11ccaec # v1 | |
| with: | |
| ruby-version: 4.0 | |
| bundler-cache: true | |
| - name: Compare performance against base | |
| shell: bash | |
| env: | |
| PASSES: 5 | |
| run: | | |
| for round in 1 2 3; do | |
| VIEW_COMPONENT_LIB=tmp/base/lib bundle exec ruby performance/measure.rb "tmp/performance/base/$round.json" | |
| bundle exec ruby performance/measure.rb "tmp/performance/head/$round.json" | |
| done | |
| bundle exec ruby performance/compare.rb tmp/performance/base tmp/performance/head | tee -a "$GITHUB_STEP_SUMMARY" | |
| - name: Upload performance results | |
| uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5 | |
| if: always() | |
| with: | |
| name: performance-rails-${{ matrix.rails_version }} | |
| path: tmp/performance | |
| test: | |
| name: test (Rails ${{ matrix.rails_version }}, Ruby ${{ matrix.ruby_version }}) | |
| runs-on: ubuntu-latest | |
| continue-on-error: ${{ matrix.ruby_version == 'head' }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - ruby_version: "3.2" | |
| rails_version: "7.1" | |
| - ruby_version: "3.3" | |
| rails_version: "7.2" | |
| - ruby_version: "3.4" | |
| rails_version: "8.0" | |
| - ruby_version: "4.0" | |
| rails_version: "8.1" | |
| - ruby_version: "4.0" | |
| rails_version: "main" | |
| - ruby_version: "head" | |
| rails_version: "main_head" | |
| env: | |
| BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: ${{ matrix.ruby_version }} | |
| bundler-cache: true | |
| - name: Build and test with Rake | |
| run: | | |
| bundle exec appraisal rails-${{ matrix.rails_version }} bundle --quiet | |
| MEASURE_COVERAGE=true bundle exec appraisal rails-${{ matrix.rails_version }} rake all_tests | |
| env: | |
| RAILS_VERSION: ${{ matrix.rails_version }} | |
| RUBY_VERSION: ${{ matrix.ruby_version }} | |
| - name: Upload coverage results | |
| uses: actions/upload-artifact@v5 | |
| if: always() | |
| with: | |
| name: simplecov-resultset-rails${{matrix.rails_version}}-ruby${{matrix.ruby_version}}-${{matrix.mode}} | |
| path: coverage | |
| 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' | |
| path: 'primer_view_components' | |
| ref: 'main' | |
| persist-credentials: false | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| path: 'view_component' | |
| persist-credentials: false | |
| - name: Setup Ruby | |
| 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@7f797815d8adceb1c412e7abefdd1ab4abc47a5f # v1 | |
| with: | |
| ruby-version: 4.0 | |
| bundler-cache: true | |
| working-directory: 'primer_view_components' | |
| - uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5 | |
| with: | |
| node-version: 22 | |
| cache: 'npm' | |
| cache-dependency-path: | | |
| primer_view_components/package-lock.json | |
| primer_view_components/demo/package-lock.json | |
| - name: Install JavaScript dependencies | |
| run: | | |
| npm ci | |
| npm ci --prefix demo | |
| - name: Test with Rake | |
| shell: bash | |
| env: | |
| RAKE_TASKS: ${{ matrix.tasks }} | |
| run: | | |
| read -r -a tasks <<< "$RAKE_TASKS" | |
| bundle exec rake "${tasks[@]}" | |
| coverage: | |
| needs: test | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 | |
| with: | |
| persist-credentials: false | |
| - name: Setup Ruby | |
| uses: ruby/setup-ruby@v1 | |
| with: | |
| ruby-version: 4.0 | |
| bundler-cache: true | |
| - name: Download coverage results | |
| uses: actions/download-artifact@v5 | |
| - name: Collate simplecov | |
| run: | | |
| bundle exec rake coverage:report |