From 5c0ef93aa794338c568d9eb4fb11c6b660fe483a Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Tue, 28 Jan 2025 11:54:22 +0100 Subject: [PATCH] WIP --- .github/workflows/test.yml | 9 +++------ tasks/github.rake | 24 ++++++++++++++++++------ 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 277a8805ad9..62eccc2ef68 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,8 +33,7 @@ jobs: with: name: bundled-lockfile-${{ github.run_id }}-${{ matrix.engine.alias }} retention-days: 1 - path: | - Gemfile.lock + path: Gemfile.lock - id: set-matrix run: | matrix_json=$(bundle exec rake github:generate_matrix) @@ -43,14 +42,12 @@ jobs: echo "$matrix_json" # Set the output echo "${{ matrix.engine.alias }}=$matrix_json" >> $GITHUB_OUTPUT - - run: bundle exec rake dependency:install - uses: actions/upload-artifact@v4 with: name: bundled-dependencies-${{ github.run_id }}-${{ matrix.engine.alias }} retention-days: 1 - path: | - /usr/local/bundle + path: "/usr/local/bundle" test-ruby-33: name: ruby-3.3 batch ${{ matrix.batch }} needs: @@ -90,7 +87,7 @@ jobs: - uses: actions/download-artifact@v4 with: name: bundled-dependencies-${{ github.run_id }}-ruby-33 - path: /usr/local/bundle + path: "/usr/local/bundle" - run: bundle install - name: Run batched tests env: diff --git a/tasks/github.rake b/tasks/github.rake index 9bc6bd88ce0..1ef7cc4c3db 100644 --- a/tasks/github.rake +++ b/tasks/github.rake @@ -82,13 +82,20 @@ namespace :github do 'name' => 'Configure Git', 'run' => 'git config --global --add safe.directory "$GITHUB_WORKSPACE"' }, + { + 'uses' => 'actions/download-artifact@v4', + 'with' => { + 'name' => "bundled-lockfile-${{ github.run_id }}-#{runtime.alias}", + } + }, { 'uses' => 'actions/download-artifact@v4', 'with' => { 'name' => "bundled-dependencies-${{ github.run_id }}-#{runtime.alias}", + 'path' => '/usr/local/bundle' } }, - { 'run' => 'bundle install --local' }, + { 'run' => 'bundle install' }, { 'name' => 'Run batched tests', 'env' => { 'MATRIX_TASKS' => '${{ toJSON(matrix.tasks) }}' }, @@ -118,6 +125,14 @@ namespace :github do 'steps' => [ { 'uses' => 'actions/checkout@v4' }, { 'run' => 'bundle install' }, + { + 'uses' => 'actions/upload-artifact@v4', + 'with' => { + 'name' => 'bundled-lockfile-${{ github.run_id }}-${{ matrix.engine.alias }}', + 'retention-days' => 1, + 'path' => 'Gemfile.lock' + } + }, { 'id' => 'set-matrix', 'run' => <<~BASH @@ -129,16 +144,13 @@ namespace :github do echo "${{ matrix.engine.alias }}=$matrix_json" >> $GITHUB_OUTPUT BASH }, - { 'run' => 'bundle cache' }, + { 'run' => 'bundle exec rake dependency:install' }, { 'uses' => 'actions/upload-artifact@v4', 'with' => { 'name' => 'bundled-dependencies-${{ github.run_id }}-${{ matrix.engine.alias }}', 'retention-days' => 1, - 'path' => <<~STRING - Gemfile.lock - vendor/ - STRING + 'path' => '/usr/local/bundle' } }, ]