From d92bba85a02d679a0df23b47db292af045c85745 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 6 Apr 2021 17:57:32 +0200 Subject: [PATCH] DEV: Check for files not dirs before rspec/qunit --- .github/workflows/plugin-tests.yml | 34 ++++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/.github/workflows/plugin-tests.yml b/.github/workflows/plugin-tests.yml index cf0a527..36fb2d0 100644 --- a/.github/workflows/plugin-tests.yml +++ b/.github/workflows/plugin-tests.yml @@ -58,18 +58,6 @@ jobs: path: plugins/${{ github.event.repository.name }} fetch-depth: 1 - - name: Check spec existence - id: check_spec - uses: andstor/file-existence-action@v1 - with: - files: "plugins/${{ github.event.repository.name }}/spec" - - - name: Check qunit existence - id: check_qunit - uses: andstor/file-existence-action@v1 - with: - files: "plugins/${{ github.event.repository.name }}/test/javascripts" - - name: Setup Git run: | git config --global user.email "ci@ci.invalid" @@ -121,11 +109,29 @@ jobs: bin/rake db:create bin/rake db:migrate + - name: Check spec existence + id: check_spec + shell: bash + run: | + shopt -s extglob + if ls plugins/${{ github.event.repository.name }}/spec/**/*.@(rb) &> /dev/null; then + echo "::set-output name=files_exist::true" + fi + - name: Plugin RSpec - if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exists == 'true' + if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exist == 'true' run: bin/rake plugin:spec[${{ github.event.repository.name }}] + - name: Check qunit existence + id: check_qunit + shell: bash + run: | + shopt -s extglob + if ls plugins/${{ github.event.repository.name }}/test/javascripts/**/*.@(js|es6) &> /dev/null; then + echo "::set-output name=files_exist::true" + fi + - name: Plugin QUnit - if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exists == 'true' + if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exist == 'true' run: bundle exec rake plugin:qunit['${{ github.event.repository.name }}','1200000'] timeout-minutes: 30