DEV: Update CI workflows (#210)
* 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>
This commit is contained in:
parent
85fa1f90aa
commit
ac0f8a6ee3
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,7 +1,4 @@
|
|||
import {
|
||||
acceptance,
|
||||
exists
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { acceptance, exists } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
import I18n from "I18n";
|
||||
|
|
|
@ -7,7 +7,9 @@ import { click, currentURL, visit } from "@ember/test-helpers";
|
|||
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
|
||||
import { test } from "qunit";
|
||||
|
||||
acceptance("Discourse Assign | Quick access assignments panel", function (needs) {
|
||||
acceptance(
|
||||
"Discourse Assign | Quick access assignments panel",
|
||||
function (needs) {
|
||||
needs.user();
|
||||
needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
|
||||
|
||||
|
@ -36,4 +38,5 @@ acceptance("Discourse Assign | Quick access assignments panel", function (needs)
|
|||
"a second click should redirect to the full assignments page"
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import {
|
||||
acceptance,
|
||||
query,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { acceptance, query } from "discourse/tests/helpers/qunit-helpers";
|
||||
import { fillIn, visit } from "@ember/test-helpers";
|
||||
import { test } from "qunit";
|
||||
|
||||
|
|
|
@ -1,10 +1,16 @@
|
|||
import selectKit from "discourse/tests/helpers/select-kit-helper";
|
||||
import {acceptance, count, exists} from "discourse/tests/helpers/qunit-helpers";
|
||||
import {visit} from "@ember/test-helpers";
|
||||
import {
|
||||
acceptance,
|
||||
count,
|
||||
exists,
|
||||
} from "discourse/tests/helpers/qunit-helpers";
|
||||
import { visit } from "@ember/test-helpers";
|
||||
import AssignedTopics from "../fixtures/assigned-topics-fixtures";
|
||||
import {test} from "qunit";
|
||||
import { test } from "qunit";
|
||||
|
||||
acceptance("Discourse Assign | UnAssign/Re-assign from the topics list", function (needs) {
|
||||
acceptance(
|
||||
"Discourse Assign | UnAssign/Re-assign from the topics list",
|
||||
function (needs) {
|
||||
needs.user();
|
||||
needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
|
||||
needs.pretender((server, helper) => {
|
||||
|
@ -22,17 +28,21 @@ acceptance("Discourse Assign | UnAssign/Re-assign from the topics list", functio
|
|||
assert.equal(count("li[data-value='unassign']"), 1);
|
||||
assert.equal(count("li[data-value='reassign']"), 1);
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
acceptance("Discourse Assign | A user doesn't have assignments", function (needs) {
|
||||
acceptance(
|
||||
"Discourse Assign | A user doesn't have assignments",
|
||||
function (needs) {
|
||||
needs.user();
|
||||
needs.settings({ assign_enabled: true, assigns_user_url_path: "/" });
|
||||
needs.pretender((server, helper) => {
|
||||
const assignments = AssignedTopics["/topics/messages-assigned/eviltrout.json"];
|
||||
const assignments =
|
||||
AssignedTopics["/topics/messages-assigned/eviltrout.json"];
|
||||
assignments.topic_list.topics = [];
|
||||
server.get(
|
||||
"/topics/messages-assigned/eviltrout.json",
|
||||
() => helper.response(assignments));
|
||||
server.get("/topics/messages-assigned/eviltrout.json", () =>
|
||||
helper.response(assignments)
|
||||
);
|
||||
});
|
||||
|
||||
test("It renders the empty state panel", async function (assert) {
|
||||
|
@ -44,4 +54,5 @@ acceptance("Discourse Assign | A user doesn't have assignments", function (needs
|
|||
await visit("/u/eviltrout/activity/assigned");
|
||||
assert.notOk(exists("div.topic-search-div"));
|
||||
});
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue