From b3367ba9d2232e00f2ae66d4c4da5787c039f953 Mon Sep 17 00:00:00 2001 From: discoursebot Date: Thu, 11 Feb 2021 10:18:24 -0600 Subject: [PATCH] DEV: Update CI workflows (#144) * DEV: Update CI workflows * DEV: Update Gemfile.lock Co-authored-by: CvX Co-authored-by: Justin DiRose --- .github/workflows/plugin-linting.yml | 6 ++--- .github/workflows/plugin-tests.yml | 36 +++++++++++++--------------- Gemfile.lock | 1 + 3 files changed, 20 insertions(+), 23 deletions(-) diff --git a/.github/workflows/plugin-linting.yml b/.github/workflows/plugin-linting.yml index affe103..f43eae8 100644 --- a/.github/workflows/plugin-linting.yml +++ b/.github/workflows/plugin-linting.yml @@ -23,12 +23,10 @@ jobs: uses: ruby/setup-ruby@v1 with: ruby-version: 2.7 - - - name: Setup gems - run: bundle install --jobs 4 + bundler-cache: true - name: Yarn install - run: yarn install --dev + run: yarn install - name: ESLint run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts diff --git a/.github/workflows/plugin-tests.yml b/.github/workflows/plugin-tests.yml index ad05806..cf0a527 100644 --- a/.github/workflows/plugin-tests.yml +++ b/.github/workflows/plugin-tests.yml @@ -11,13 +11,14 @@ jobs: build: name: ${{ matrix.build_type }} runs-on: ubuntu-latest + container: discourse/discourse_test:release timeout-minutes: 60 env: DISCOURSE_HOSTNAME: www.example.com RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072 RAILS_ENV: test - PGHOST: localhost + PGHOST: postgres PGUSER: discourse PGPASSWORD: discourse @@ -74,29 +75,26 @@ jobs: git config --global user.email "ci@ci.invalid" git config --global user.name "Discourse CI" - - name: Setup packages - run: | - sudo apt-get update - sudo apt-get -yqq install postgresql-client libpq-dev gifsicle jpegoptim optipng jhead - wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-pngquant | sudo sh - - - name: Update imagemagick - if: matrix.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 with: redis-version: ${{ matrix.redis }} - - name: Setup ruby - uses: ruby/setup-ruby@v1 + - name: Bundler cache + uses: actions/cache@v2 with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true + path: vendor/bundle + key: ${{ runner.os }}-${{ matrix.ruby }}-gem-${{ hashFiles('**/Gemfile.lock') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ruby }}-gem- + + - name: Setup gems + run: | + bundle config --local path vendor/bundle + bundle config --local deployment true + bundle config --local without development + bundle install --jobs 4 + bundle clean - name: Lint English locale if: matrix.build_type == 'backend' @@ -116,7 +114,7 @@ jobs: ${{ runner.os }}-${{ matrix.os }}-yarn- - name: Yarn install - run: yarn install --dev + run: yarn install - name: Migrate database run: | diff --git a/Gemfile.lock b/Gemfile.lock index 25eeb8a..20f57a5 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,4 +1,5 @@ GEM + remote: https://rubygems.org/ specs: ast (2.4.0) jaro_winkler (1.5.4)