DEV: Update CI workflows (#17)

DEV: Update CI workflows (#17)

  • DEV: Update CI workflows
  • DEV: Fix prettier errors in tests

Co-authored-by: CvX CvX@users.noreply.github.com Co-authored-by: Jarek Radosz jradosz@gmail.com

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
 
diff --git a/test/javascripts/components/bcc-checkbox-test.js.es6 b/test/javascripts/components/bcc-checkbox-test.js.es6
index 5ebd271..7574a2b 100644
--- a/test/javascripts/components/bcc-checkbox-test.js.es6
+++ b/test/javascripts/components/bcc-checkbox-test.js.es6
@@ -9,7 +9,7 @@ componentTest("it doesn't show up by default", {
   },
   test(assert) {
     assert.ok(find(".bcc-checkbox").length === 0);
-  }
+  },
 });
 
 componentTest("doesn't show up for non-staff", {
@@ -17,7 +17,7 @@ componentTest("doesn't show up for non-staff", {
 
   async test(assert) {
     assert.ok(find(".bcc-checkbox").length === 0);
-  }
+  },
 });
 
 componentTest("it shows up if a private message with at least 1 username", {
@@ -34,5 +34,5 @@ componentTest("it shows up if a private message with at least 1 username", {
     assert.ok(find(".bcc-checkbox input[type=checkbox]").length === 1);
     await click(".bcc-checkbox input[type=checkbox]");
     assert.ok(this.get("changeMe"));
-  }
+  },
 });

GitHub sha: 1063f4a95f57a5c7b53ba24a4e5fd2302d5a808d

This commit appears in #17 which was approved by eviltrout. It was merged by CvX.