mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 10:57:04 +08:00
DEV: Use discourse/discourse_test in CI workflows
Using our testing Docker image (`discourse/discourse_test:release`) allows us to drop "Update imagemagick" step which shaves ~10 minutes from all runs.
This commit is contained in:
parent
f5b18e2a31
commit
abe688beb3
41
.github/workflows/ci.yml
vendored
41
.github/workflows/ci.yml
vendored
|
@ -12,6 +12,7 @@ jobs:
|
|||
build:
|
||||
name: "${{ matrix.target }}-${{ matrix.build_types }}"
|
||||
runs-on: ${{ matrix.os }}
|
||||
container: discourse/discourse_test:release
|
||||
timeout-minutes: 60
|
||||
|
||||
env:
|
||||
|
@ -20,7 +21,7 @@ jobs:
|
|||
BUILD_TYPE: ${{ matrix.build_types }}
|
||||
TARGET: ${{ matrix.target }}
|
||||
RAILS_ENV: test
|
||||
PGHOST: localhost
|
||||
PGHOST: postgres
|
||||
PGUSER: discourse
|
||||
PGPASSWORD: discourse
|
||||
|
||||
|
@ -61,49 +62,27 @@ jobs:
|
|||
git config --global user.email "ci@ci.invalid"
|
||||
git config --global user.name "Discourse CI"
|
||||
|
||||
- name: Setup packages
|
||||
if: env.BUILD_TYPE != 'LINT'
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get -yqq install postgresql-client libpq-dev jpegoptim optipng jhead pngcrush pngquant
|
||||
wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-pngquant | sudo sh
|
||||
|
||||
- name: Update imagemagick
|
||||
if: env.BUILD_TYPE == 'BACKEND'
|
||||
run: |
|
||||
wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-imagemagick
|
||||
chmod +x install-imagemagick
|
||||
sudo ./install-imagemagick
|
||||
|
||||
- name: Setup redis
|
||||
uses: shogo82148/actions-setup-redis@v1
|
||||
if: env.BUILD_TYPE != 'LINT'
|
||||
with:
|
||||
redis-version: ${{ matrix.redis }}
|
||||
|
||||
- name: Setup ruby
|
||||
uses: actions/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: ${{ matrix.ruby }}
|
||||
|
||||
- name: Setup bundler
|
||||
run: |
|
||||
gem install bundler -v 2.1.4 --no-doc
|
||||
bundle config deployment 'true'
|
||||
bundle config without 'development'
|
||||
bundle config path vendor/bundle
|
||||
|
||||
- name: Bundler cache
|
||||
uses: actions/cache@v2
|
||||
id: bundler-cache
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
||||
key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gem-
|
||||
${{ runner.os }}-${{ matrix.ruby }}-gem-
|
||||
|
||||
- name: Setup gems
|
||||
run: bundle install --jobs 4
|
||||
run: |
|
||||
bundle config --local path vendor/bundle
|
||||
bundle config --local deployment true
|
||||
bundle config --local without development
|
||||
bundle install --jobs 4
|
||||
bundle clean
|
||||
|
||||
- name: Get yarn cache directory
|
||||
id: yarn-cache-dir
|
||||
|
|
|
@ -109,6 +109,7 @@ task "qunit:test", [:timeout, :qunit_path] do |_, args|
|
|||
ensure
|
||||
# was having issues with HUP
|
||||
Process.kill "KILL", pid
|
||||
FileUtils.rm("#{Rails.root}/tmp/pids/unicorn_test_#{port}.pid")
|
||||
end
|
||||
|
||||
if success
|
||||
|
|
Loading…
Reference in New Issue
Block a user