diff --git a/.github/workflows/plugin-linting.yml b/.github/workflows/plugin-linting.yml index 7534015..17864e9 100644 --- a/.github/workflows/plugin-linting.yml +++ b/.github/workflows/plugin-linting.yml @@ -34,7 +34,7 @@ jobs: run: yarn install --dev - name: ESLint - run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern assets/javascripts + run: yarn eslint --ext .js,.js.es6 --no-error-on-unmatched-pattern {test,assets}/javascripts - name: Prettier run: | @@ -42,6 +42,9 @@ jobs: if [ -d "assets" ]; then \ yarn prettier --list-different "assets/**/*.{scss,js,es6}" ; \ fi + if [ -d "test" ]; then \ + yarn prettier --list-different "test/**/*.{js,es6}" ; \ + fi - name: Rubocop run: bundle exec rubocop . diff --git a/.github/workflows/plugin-tests.yml b/.github/workflows/plugin-tests.yml index 80a05e9..bee02fb 100644 --- a/.github/workflows/plugin-tests.yml +++ b/.github/workflows/plugin-tests.yml @@ -9,15 +9,13 @@ on: jobs: build: - name: "${{ matrix.target }}-${{ matrix.build_types }}" + name: ${{ matrix.build_type }} runs-on: ${{ matrix.os }} timeout-minutes: 60 env: DISCOURSE_HOSTNAME: www.example.com RUBY_GLOBAL_METHOD_CACHE_SIZE: 131072 - BUILD_TYPE: ${{ matrix.build_types }} - TARGET: ${{ matrix.target }} RAILS_ENV: test PGHOST: localhost PGUSER: discourse @@ -27,8 +25,7 @@ jobs: fail-fast: false matrix: - build_types: ["BACKEND", "FRONTEND"] - target: ["PLUGINS"] + build_type: ["backend", "frontend"] os: [ubuntu-latest] ruby: ["2.6"] postgres: ["12"] @@ -85,7 +82,7 @@ jobs: wget -qO- https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-pngquant | sudo sh - name: Update imagemagick - if: env.BUILD_TYPE == 'BACKEND' + if: matrix.build_type == 'backend' run: | wget https://raw.githubusercontent.com/discourse/discourse_docker/master/image/base/install-imagemagick chmod +x install-imagemagick @@ -140,28 +137,11 @@ jobs: bin/rake db:create bin/rake db:migrate - - name: Create parallel databases - if: env.BUILD_TYPE == 'BACKEND' && env.TARGET == 'CORE' - run: | - bin/rake parallel:create - bin/rake parallel:migrate - - - name: Core RSpec - if: env.BUILD_TYPE == 'BACKEND' && env.TARGET == 'CORE' - run: | - bin/turbo_rspec - bin/rake plugin:spec - - name: Plugin RSpec - if: env.BUILD_TYPE == 'BACKEND' && env.TARGET == 'PLUGINS' && steps.check_spec.outputs.files_exists == 'true' + if: matrix.build_type == 'backend' && steps.check_spec.outputs.files_exists == 'true' run: bin/rake plugin:spec[${{ github.event.repository.name }}] - - name: Core QUnit - if: env.BUILD_TYPE == 'FRONTEND' && env.TARGET == 'CORE' - run: bundle exec rake qunit:test['1200000'] - timeout-minutes: 30 - - name: Plugin QUnit - if: env.BUILD_TYPE == 'FRONTEND' && env.TARGET == 'PLUGINS' && steps.check_qunit.outputs.files_exists == 'true' + if: matrix.build_type == 'frontend' && steps.check_qunit.outputs.files_exists == 'true' run: bundle exec rake plugin:qunit['${{ github.event.repository.name }}','1200000'] timeout-minutes: 30 diff --git a/test/javascripts/acceptance/assign-disabled-test.js.es6 b/test/javascripts/acceptance/assign-disabled-test.js.es6 index f36b55a..1f2310c 100644 --- a/test/javascripts/acceptance/assign-disabled-test.js.es6 +++ b/test/javascripts/acceptance/assign-disabled-test.js.es6 @@ -1,5 +1,8 @@ import selectKit from "discourse/tests/helpers/select-kit-helper"; -import { acceptance, updateCurrentUser } from "discourse/tests/helpers/qunit-helpers"; +import { + acceptance, + updateCurrentUser, +} from "discourse/tests/helpers/qunit-helpers"; import { clearTopicFooterButtons } from "discourse/lib/register-topic-footer-button"; acceptance("Assign disabled mobile", function (needs) { diff --git a/test/javascripts/acceptance/assign-enabled-test.js.es6 b/test/javascripts/acceptance/assign-enabled-test.js.es6 index 3ac2c26..9ed1644 100644 --- a/test/javascripts/acceptance/assign-enabled-test.js.es6 +++ b/test/javascripts/acceptance/assign-enabled-test.js.es6 @@ -1,5 +1,8 @@ import selectKit from "discourse/tests/helpers/select-kit-helper"; -import { acceptance, updateCurrentUser } from "discourse/tests/helpers/qunit-helpers"; +import { + acceptance, + updateCurrentUser, +} from "discourse/tests/helpers/qunit-helpers"; import { clearTopicFooterButtons } from "discourse/lib/register-topic-footer-button"; acceptance("Assign mobile", function (needs) { diff --git a/test/javascripts/acceptance/quick-access-assignments-test.js.es6 b/test/javascripts/acceptance/quick-access-assignments-test.js.es6 index 53b402d..f1d3457 100644 --- a/test/javascripts/acceptance/quick-access-assignments-test.js.es6 +++ b/test/javascripts/acceptance/quick-access-assignments-test.js.es6 @@ -1,11 +1,15 @@ -import { acceptance, updateCurrentUser, queryAll } from "discourse/tests/helpers/qunit-helpers"; +import { + acceptance, + updateCurrentUser, + queryAll, +} from "discourse/tests/helpers/qunit-helpers"; import { default as AssignedTopics } from "../fixtures/assigned-topics-fixtures"; const USER_MENU = "#current-user.header-dropdown-toggle"; acceptance("Quick access assignments panel", function (needs) { needs.user(); - needs.settings({ assign_enabled: true, assigns_user_url_path: "/"}); + needs.settings({ assign_enabled: true, assigns_user_url_path: "/" }); needs.pretender((server, helper) => { const messagesPath = "/topics/messages-assigned/eviltrout.json"; diff --git a/test/javascripts/acceptance/un-assign-from-list-test.js.es6 b/test/javascripts/acceptance/un-assign-from-list-test.js.es6 index bfa2fb9..26ae33e 100644 --- a/test/javascripts/acceptance/un-assign-from-list-test.js.es6 +++ b/test/javascripts/acceptance/un-assign-from-list-test.js.es6 @@ -4,7 +4,7 @@ import { default as AssignedTopics } from "../fixtures/assigned-topics-fixtures" acceptance("UnAssign/Re-assign from the topics list", function (needs) { needs.user(); - needs.settings({ assign_enabled: true, assigns_user_url_path: "/"}); + needs.settings({ assign_enabled: true, assigns_user_url_path: "/" }); needs.pretender((server, helper) => { const messagesPath = "/topics/messages-assigned/eviltrout.json"; const assigns = AssignedTopics[messagesPath];