Try to copy cache over from the directories in the image

This commit is contained in:
Alan Guo Xiang Tan 2024-09-13 15:41:47 +08:00
parent 799b68b5bd
commit 953e766c92
No known key found for this signature in database
GPG Key ID: 286D2AB58F8C86B6
5 changed files with 42 additions and 56 deletions

View File

@ -18,7 +18,7 @@ jobs:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: run
runs-on: debian-12
container: discourse/discourse_test:slim
container: discourse/discourse_test:release
timeout-minutes: 10
steps:
@ -31,19 +31,13 @@ jobs:
git config --global user.email "ci@ci.invalid"
git config --global user.name "Discourse CI"
- name: Bundler cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: Setup gems
- name: bundle install
run: |
bundle config --local path vendor/bundle
cp -r /var/www/discourse/vendor/bundle ./vendor/bundle
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
bundle config --local deployment true
bundle config --local without development
bundle install --jobs 4
bundle install --jobs $(($(nproc) - 1))
bundle clean
- name: Setup licensed

View File

@ -18,7 +18,7 @@ jobs:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: run
runs-on: debian-12
container: discourse/discourse_test:slim
container: discourse/discourse_test:release
timeout-minutes: 30
steps:
@ -34,20 +34,13 @@ jobs:
git config --global user.email "ci@ci.invalid"
git config --global user.name "Discourse CI"
- name: Bundler cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: Setup gems
- name: bundle install
run: |
cp -r /var/www/discourse/vendor/bundle ./vendor/bundle
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
bundle config --local path vendor/bundle
bundle config --local deployment true
bundle config --local without development
bundle install --jobs 4
bundle install --jobs $(($(nproc) - 1))
bundle clean
- name: pnpm install

View File

@ -25,7 +25,7 @@ jobs:
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
name: Tests with Ruby ${{ matrix.ruby }}
runs-on: debian-12
container: discourse/discourse_test:slim
container: discourse/discourse_test:release
timeout-minutes: 20
env:
@ -69,21 +69,10 @@ jobs:
echo "debian_release=$DEBIAN_RELEASE" >> $GITHUB_OUTPUT
shell: bash
- name: Bundler cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: >-
${{ runner.os }}-
${{ steps.container-envs.outputs.ruby_version }}-
${{ steps.container-envs.outputs.debian_release }}-
${{ hashFiles('**/Gemfile.lock') }}-
migrations-tooling
- name: Setup gems
- name: bundle install
run: |
cp -r /var/www/discourse/vendor/bundle ./vendor/bundle
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
bundle config --local path vendor/bundle
bundle config --local deployment true
bundle config --local without development
bundle config --local with migrations
@ -126,11 +115,11 @@ jobs:
if: steps.app-cache.outputs.cache-hit != 'true'
run: rm -rf tmp/app-cache/uploads && cp -r public/uploads tmp/app-cache/uploads
# - name: Check core database drift
# run: |
# mkdir /tmp/intermediate_db
# ./migrations/scripts/schema_generator /tmp/intermediate_db/base_migration.sql
# diff -u migrations/common/intermediate_db_schema/000_base_schema.sql /tmp/intermediate_db/base_migration.sql
# - name: Check core database drift
# run: |
# mkdir /tmp/intermediate_db
# ./migrations/scripts/schema_generator /tmp/intermediate_db/base_migration.sql
# diff -u migrations/common/intermediate_db_schema/000_base_schema.sql /tmp/intermediate_db/base_migration.sql
- name: RSpec
run: bin/rspec --default-path migrations/spec

View File

@ -4,14 +4,14 @@ on:
workflow_dispatch:
inputs:
from:
description: 'Starting ref (exclusive). Can be a tag, branch or commit ref. `latest-release` refers to the last beta version bump.'
description: "Starting ref (exclusive). Can be a tag, branch or commit ref. `latest-release` refers to the last beta version bump."
required: true
default: 'latest-release'
default: "latest-release"
type: string
to:
description: 'Ending ref (inclusive). Can be a tag, branch or commit ref. `HEAD` refers to the most recent commit.'
description: "Ending ref (inclusive). Can be a tag, branch or commit ref. `HEAD` refers to the most recent commit."
required: true
default: 'HEAD'
default: "HEAD"
type: string
permissions:
@ -35,19 +35,13 @@ jobs:
with:
fetch-depth: 0
- name: Bundler cache
uses: actions/cache@v4
with:
path: vendor/bundle
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
restore-keys: ${{ runner.os }}-gem-
- name: Setup gems
- name: bundle install
run: |
bundle config --local path vendor/bundle
cp -r /var/www/discourse/vendor/bundle ./vendor/bundle
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
bundle config --local deployment true
bundle config --local without development
bundle install --jobs 4
bundle install --jobs $(($(nproc) - 1))
bundle clean
- name: Create output dir
@ -87,7 +81,7 @@ jobs:
echo "From: $from_ref - $(git rev-parse --short $from_ref) - ${{ steps.dates.outputs.from }}" >> $GITHUB_STEP_SUMMARY
echo "To: $to_ref - $(git rev-parse --short $to_ref) - ${{ steps.dates.outputs.to }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "---" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY

View File

@ -44,6 +44,7 @@ jobs:
DISCOURSE_TURBO_RSPEC_RETRY_AND_LOG_FLAKY_TESTS: ${{ (matrix.build_type == 'system' || matrix.build_type == 'backend') && github.ref == 'refs/heads/main' && '1' }}
CHEAP_SOURCE_MAPS: "1"
TESTEM_DEFAULT_BROWSER: Chrome
MINIO_RUNNER_INSTALL_DIR: /home/discourse/.minio_runner
strategy:
fail-fast: false
@ -110,14 +111,25 @@ jobs:
- name: bundle install
run: |
cp -r /var/www/discourse/vendor/bundle ./vendor/bundle
gem install bundler --conservative -v $(awk '/BUNDLED WITH/ { getline; gsub(/ /,""); print $0 }' Gemfile.lock)
bundle config --local deployment true
bundle config --local without development
bundle install --jobs $(($(nproc) - 1))
bundle clean
- name: pnpm install
run: pnpm install --frozen-lockfile
- name: Copy official plugins
if: matrix.target == 'plugins'
run: |
cp -r /var/www/discourse/plugins/* plugins/
- name: Checkout official plugins
if: matrix.target == 'plugins'
run: bin/rake plugin:install_all_official
# Remove discourse-ai from stable as it is not compatible with Ruby 3.3 which we are now using for the base image
- name: Remove discourse-ai from stable
if: matrix.target == 'plugins' && (github.ref_name == 'stable' || github.base_ref == 'stable')
@ -237,6 +249,10 @@ jobs:
if: matrix.build_type == 'system'
run: bin/ember-cli --build
- name: Ensure latest minio binary installed for Core System Tests
if: matrix.build_type == 'system' && matrix.target == 'core'
run: bundle exec ruby script/install_minio_binaries.rb
- name: Core System Tests
if: matrix.build_type == 'system' && matrix.target == 'core'
env: