Skip to content

Commit 60c3a6e

Browse files
discoursebotCvX
andauthored
DEV: Update CI workflows (discourse#52)
Co-authored-by: CvX <CvX@users.noreply.github.com>
1 parent 5663d1f commit 60c3a6e

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

.github/workflows/plugin-linting.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ jobs:
3737
shell: bash
3838
run: |
3939
yarn prettier -v
40-
shopt -s extglob
41-
if ls assets/**/*.@(scss|js|es6) &> /dev/null; then
40+
if [ 0 -lt $(find assets -type f \( -name "*.scss" -or -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
4241
yarn prettier --list-different "assets/**/*.{scss,js,es6}"
4342
fi
44-
if ls test/**/*.@(js|es6) &> /dev/null; then
43+
if [ 0 -lt $(find test -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
4544
yarn prettier --list-different "test/**/*.{js,es6}"
4645
fi
4746

.github/workflows/plugin-tests.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ jobs:
2929
build_type: ["backend", "frontend"]
3030
ruby: ["2.7"]
3131
postgres: ["13"]
32-
redis: ["4.x"]
3332

3433
services:
3534
postgres:
@@ -63,10 +62,9 @@ jobs:
6362
git config --global user.email "ci@ci.invalid"
6463
git config --global user.name "Discourse CI"
6564
66-
- name: Setup redis
67-
uses: shogo82148/actions-setup-redis@v1
68-
with:
69-
redis-version: ${{ matrix.redis }}
65+
- name: Start redis
66+
run: |
67+
redis-server /etc/redis/redis.conf &
7068
7169
- name: Bundler cache
7270
uses: actions/cache@v2
@@ -113,8 +111,7 @@ jobs:
113111
id: check_spec
114112
shell: bash
115113
run: |
116-
shopt -s extglob
117-
if ls plugins/${{ github.event.repository.name }}/spec/**/*.@(rb) &> /dev/null; then
114+
if [ 0 -lt $(find plugins/${{ github.event.repository.name }}/spec -type f -name "*.rb" 2> /dev/null | wc -l) ]; then
118115
echo "::set-output name=files_exist::true"
119116
fi
120117
@@ -126,8 +123,7 @@ jobs:
126123
id: check_qunit
127124
shell: bash
128125
run: |
129-
shopt -s extglob
130-
if ls plugins/${{ github.event.repository.name }}/test/javascripts/**/*.@(js|es6) &> /dev/null; then
126+
if [ 0 -lt $(find plugins/${{ github.event.repository.name }}/test/javascripts -type f \( -name "*.js" -or -name "*.es6" \) 2> /dev/null | wc -l) ]; then
131127
echo "::set-output name=files_exist::true"
132128
fi
133129

0 commit comments

Comments
 (0)