mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 06:02:41 +08:00
DEV: Run tests workflow using discourse/discourse_test:release
image
This commit updates the tests workflow to use the `discourse/discourse_test:release` image. This allows us to drop the some usage of Github actions cache which can be quite slow to fetch from our self hosted runners.
This commit is contained in:
parent
def0d13cd9
commit
cf9709ef16
49
.github/workflows/tests.yml
vendored
49
.github/workflows/tests.yml
vendored
|
@ -29,8 +29,8 @@ jobs:
|
||||||
build:
|
build:
|
||||||
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
|
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
|
||||||
name: ${{ matrix.target }} ${{ matrix.build_type }} # Update fetch-job-id step if changing this
|
name: ${{ matrix.target }} ${{ matrix.build_type }} # Update fetch-job-id step if changing this
|
||||||
runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-22.04-8core') || 'debian-12' }}
|
runs-on: ${{ (github.repository_owner == 'discourse' && 'debian-12') || 'ubuntu-latest' }}
|
||||||
container: discourse/discourse_test:${{ (github.repository == 'discourse/discourse' && 'release') || format('slim{0}', (matrix.build_type == 'frontend' || matrix.build_type == 'system') && '-browsers' || '') }}
|
container: discourse/discourse_test:release
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
@ -109,16 +109,9 @@ jobs:
|
||||||
echo "debian_release=$DEBIAN_RELEASE" >> $GITHUB_OUTPUT
|
echo "debian_release=$DEBIAN_RELEASE" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Bundler cache
|
- name: Symlink vendor/bundle from image
|
||||||
uses: actions/cache@v4
|
run: |
|
||||||
if: github.repository != 'discourse/discourse'
|
ln -s /var/www/discourse/vendor/bundle vendor/bundle
|
||||||
with:
|
|
||||||
path: vendor/bundle
|
|
||||||
key: ${{ runner.os }}-${{ steps.container-envs.outputs.ruby_version }}-${{ steps.container-envs.outputs.debian_release }}-gem-${{ hashFiles('**/Gemfile.lock') }}-cachev2
|
|
||||||
|
|
||||||
- name: Copy gems to vendor/bundle
|
|
||||||
if: github.repository == 'discourse/discourse'
|
|
||||||
run: cp -r /var/www/discourse/vendor/bundle vendor/bundle
|
|
||||||
|
|
||||||
- name: Setup gems
|
- name: Setup gems
|
||||||
run: |
|
run: |
|
||||||
|
@ -136,16 +129,25 @@ jobs:
|
||||||
if: matrix.target == 'plugins'
|
if: matrix.target == 'plugins'
|
||||||
run: bin/rake plugin:install_all_official
|
run: bin/rake plugin:install_all_official
|
||||||
|
|
||||||
|
- name: Symlinking plugin gems from image
|
||||||
|
if: matrix.target == 'plugins'
|
||||||
|
run: |
|
||||||
|
for dir in /var/www/discourse/plugins/*/gems; do
|
||||||
|
plugin_name=$(basename "$(dirname "$dir")")
|
||||||
|
dest="plugins/$plugin_name/gems"
|
||||||
|
|
||||||
|
if [ -d "$dest" ]; then
|
||||||
|
echo "Skipping $plugin_name: Source gems directory exists"
|
||||||
|
else
|
||||||
|
echo "Symlinking $dir to $dest"
|
||||||
|
ln -s "$dir" "$dest"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
- name: Pull compatible versions of plugins
|
- name: Pull compatible versions of plugins
|
||||||
if: matrix.target == 'plugins' && (github.ref_name != 'main' && github.base_ref != 'main')
|
if: matrix.target == 'plugins' && (github.ref_name != 'main' && github.base_ref != 'main')
|
||||||
run: bin/rake plugin:pull_compatible_all
|
run: bin/rake plugin:pull_compatible_all
|
||||||
|
|
||||||
- name: Plugin gems cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: plugins/*/gems
|
|
||||||
key: ${{ runner.os }}-plugin-gems-${{ steps.container-envs.outputs.ruby_version }}-${{ steps.container-envs.outputs.debian_release }}-${{ hashFiles('plugins/*/plugin.rb') }}
|
|
||||||
|
|
||||||
- name: Checkout official themes
|
- name: Checkout official themes
|
||||||
if: matrix.target == 'themes'
|
if: matrix.target == 'themes'
|
||||||
run: bin/rake themes:clone_all_official themes:pull_compatible_all
|
run: bin/rake themes:clone_all_official themes:pull_compatible_all
|
||||||
|
@ -256,13 +258,6 @@ jobs:
|
||||||
if: matrix.build_type == 'system'
|
if: matrix.build_type == 'system'
|
||||||
run: bin/ember-cli --build
|
run: bin/ember-cli --build
|
||||||
|
|
||||||
- name: Minio cache
|
|
||||||
if: matrix.build_type == 'system' && matrix.target == 'core'
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: ${{ env.MINIO_RUNNER_INSTALL_DIR }}
|
|
||||||
key: ${{ runner.os }}-${{ steps.container-envs.outputs.ruby_version }}-${{ steps.container-envs.outputs.debian_release }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
|
||||||
|
|
||||||
- name: Ensure latest minio binary installed for Core System Tests
|
- name: Ensure latest minio binary installed for Core System Tests
|
||||||
if: matrix.build_type == 'system' && matrix.target == 'core'
|
if: matrix.build_type == 'system' && matrix.target == 'core'
|
||||||
run: bundle exec ruby script/install_minio_binaries.rb
|
run: bundle exec ruby script/install_minio_binaries.rb
|
||||||
|
@ -366,9 +361,9 @@ jobs:
|
||||||
core_frontend_tests:
|
core_frontend_tests:
|
||||||
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
|
if: github.event_name == 'pull_request' || github.repository != 'discourse/discourse-private-mirror'
|
||||||
name: core frontend (${{ matrix.browser }})
|
name: core frontend (${{ matrix.browser }})
|
||||||
runs-on: ${{ (github.repository != 'discourse/discourse' && 'ubuntu-22.04-8core') || 'debian-12' }}
|
runs-on: ${{ (github.repository_owner == 'discourse' && 'debian-12') || 'ubuntu-latest' }}
|
||||||
container:
|
container:
|
||||||
image: discourse/discourse_test:slim-browsers
|
image: discourse/discourse_test:release
|
||||||
options: --user discourse
|
options: --user discourse
|
||||||
|
|
||||||
timeout-minutes: 35
|
timeout-minutes: 35
|
||||||
|
|
Loading…
Reference in New Issue
Block a user