Skip to content

Commit 785a97a

Browse files
DEV: Update CI workflows (discourse#49)
Co-authored-by: davidtaylorhq <davidtaylorhq@users.noreply.github.com>
1 parent 3e3c2ae commit 785a97a

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

.github/workflows/plugin-linting.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,20 +29,26 @@ jobs:
2929
run: yarn install
3030

3131
- name: ESLint
32+
if: ${{ always() }}
3233
run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts
3334

3435
- name: Prettier
36+
if: ${{ always() }}
37+
shell: bash
3538
run: |
3639
yarn prettier -v
37-
if [ -d "assets" ]; then \
38-
yarn prettier --list-different "assets/**/*.{scss,js,es6}" ; \
40+
shopt -s extglob
41+
if ls assets/**/*.@(scss|js|es6) &> /dev/null; then
42+
yarn prettier --list-different "assets/**/*.{scss,js,es6}"
3943
fi
40-
if [ -d "test" ]; then \
41-
yarn prettier --list-different "test/**/*.{js,es6}" ; \
44+
if ls test/**/*.@(js|es6) &> /dev/null; then
45+
yarn prettier --list-different "test/**/*.{js,es6}"
4246
fi
4347
4448
- name: Ember template lint
49+
if: ${{ always() }}
4550
run: yarn ember-template-lint assets/javascripts
4651

4752
- name: Rubocop
53+
if: ${{ always() }}
4854
run: bundle exec rubocop .

.github/workflows/plugin-tests.yml

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
matrix:
2929
build_type: ["backend", "frontend"]
3030
ruby: ["2.7"]
31-
postgres: ["12"]
31+
postgres: ["13"]
3232
redis: ["4.x"]
3333

3434
services:
@@ -58,18 +58,6 @@ jobs:
5858
path: plugins/${{ github.event.repository.name }}
5959
fetch-depth: 1
6060

61-
- name: Check spec existence
62-
id: check_spec
63-
uses: andstor/file-existence-action@v1
64-
with:
65-
files: "plugins/${{ github.event.repository.name }}/spec"
66-
67-
- name: Check qunit existence
68-
id: check_qunit
69-
uses: andstor/file-existence-action@v1
70-
with:
71-
files: "plugins/${{ github.event.repository.name }}/test/javascripts"
72-
7361
- name: Setup Git
7462
run: |
7563
git config --global user.email "ci@ci.invalid"
@@ -121,11 +109,29 @@ jobs:
121109
bin/rake db:create
122110
bin/rake db:migrate
123111
112+
- name: Check spec existence
113+
id: check_spec
114+
shell: bash
115+
run: |
116+
shopt -s extglob
117+
if ls plugins/${{ github.event.repository.name }}/spec/**/*.@(rb) &> /dev/null; then
118+
echo "::set-output name=files_exist::true"
119+
fi
120+
124121
- name: Plugin RSpec
125-
if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exists == 'true'
122+
if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exist == 'true'
126123
run: bin/rake plugin:spec[${{ github.event.repository.name }}]
127124

125+
- name: Check qunit existence
126+
id: check_qunit
127+
shell: bash
128+
run: |
129+
shopt -s extglob
130+
if ls plugins/${{ github.event.repository.name }}/test/javascripts/**/*.@(js|es6) &> /dev/null; then
131+
echo "::set-output name=files_exist::true"
132+
fi
133+
128134
- name: Plugin QUnit
129-
if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exists == 'true'
135+
if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exist == 'true'
130136
run: bundle exec rake plugin:qunit['${{ github.event.repository.name }}','1200000']
131137
timeout-minutes: 30

0 commit comments

Comments
 (0)