From 9b40f41f94c71577d922a7f499f75c1fe5987391 Mon Sep 17 00:00:00 2001 From: discoursebot Date: Wed, 15 Sep 2021 13:45:44 -0400 Subject: [PATCH] DEV: Update CI workflows (#140) Co-authored-by: CvX --- .github/workflows/plugin-linting.yml | 5 ++--- .github/workflows/plugin-tests.yml | 14 +++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/plugin-linting.yml b/.github/workflows/plugin-linting.yml index 51b9b82..92c6e3e 100644 --- a/.github/workflows/plugin-linting.yml +++ b/.github/workflows/plugin-linting.yml @@ -37,11 +37,10 @@ jobs: shell: bash run: | yarn prettier -v - shopt -s extglob - if ls assets/**/*.@(scss|js|es6) &> /dev/null; then + if [ 0 -lt $(find assets -type f \( -name "*.scss" -or -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then yarn prettier --list-different "assets/**/*.{scss,js,es6}" fi - if ls test/**/*.@(js|es6) &> /dev/null; then + if [ 0 -lt $(find test -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then yarn prettier --list-different "test/**/*.{js,es6}" fi diff --git a/.github/workflows/plugin-tests.yml b/.github/workflows/plugin-tests.yml index b28d0e2..a5eff7c 100644 --- a/.github/workflows/plugin-tests.yml +++ b/.github/workflows/plugin-tests.yml @@ -29,7 +29,6 @@ jobs: build_type: ["backend", "frontend"] ruby: ["2.7"] postgres: ["13"] - redis: ["4.x"] services: postgres: @@ -63,10 +62,9 @@ jobs: git config --global user.email "ci@ci.invalid" git config --global user.name "Discourse CI" - - name: Setup redis - uses: shogo82148/actions-setup-redis@v1 - with: - redis-version: ${{ matrix.redis }} + - name: Start redis + run: | + redis-server /etc/redis/redis.conf & - name: Bundler cache uses: actions/cache@v2 @@ -113,8 +111,7 @@ jobs: id: check_spec shell: bash run: | - shopt -s extglob - if ls plugins/${{ github.event.repository.name }}/spec/**/*.@(rb) &> /dev/null; then + if [ 0 -lt $(find plugins/${{ github.event.repository.name }}/spec -type f -name "*.rb" 2> /dev/null | wc -l) ]; then echo "::set-output name=files_exist::true" fi @@ -126,8 +123,7 @@ jobs: id: check_qunit shell: bash run: | - shopt -s extglob - if ls plugins/${{ github.event.repository.name }}/test/javascripts/**/*.@(js|es6) &> /dev/null; then + if [ 0 -lt $(find plugins/${{ github.event.repository.name }}/test/javascripts -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then echo "::set-output name=files_exist::true" fi