From efd0ad802c4dbb73e8c4baee67631a9bff4b729f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 29 Nov 2023 16:22:56 +0100 Subject: [PATCH] :sparkles: Add minor improvements to CI config --- .circleci/config.yml | 49 +++++++++++++++++++++++++++++-------------- .clj-kondo/config.edn | 6 +++--- backend/package.json | 3 ++- common/package.json | 1 + exporter/package.json | 3 ++- frontend/package.json | 3 ++- 6 files changed, 43 insertions(+), 22 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 098911969..63e3794e6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,6 +29,7 @@ jobs: - run: cd .clj-kondo && cat config.edn - run: cat .cljfmt.edn + - run: clj-kondo --version # - run: # name: "fmt check [clj]" @@ -36,22 +37,38 @@ jobs: # yarn run fmt:clj:check - run: - name: "lint [clj]" + name: common lint + working_directory: "./common" command: | + yarn install yarn run lint:clj - run: - name: "lint [scss]" + name: frontend lint working_directory: "./frontend" command: | yarn install yarn run lint:scss + yarn run lint:clj - run: - name: "tests [common]" - working_directory: "./common" + name: backend lint + working_directory: "./backend" command: | yarn install + yarn run lint:clj + + - run: + name: exporter lint + working_directory: "./exporter" + command: | + yarn install + yarn run lint:clj + + - run: + name: "common tests" + working_directory: "./common" + command: | yarn test clojure -X:dev:test :patterns '["common-tests.*-test"]' @@ -61,7 +78,18 @@ jobs: NODE_OPTIONS: --max-old-space-size=4096 - run: - name: "tests [backend]" + name: "frontend tests" + working_directory: "./frontend" + command: | + yarn install + yarn test + + environment: + PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin + NODE_OPTIONS: --max-old-space-size=4096 + + - run: + name: "backend tests" working_directory: "./backend" command: | clojure -X:dev:test :patterns '["backend-tests.*-test"]' @@ -73,17 +101,6 @@ jobs: PENPOT_TEST_REDIS_URI: "redis://localhost/1" JVM_OPTS: -Xmx4g - - run: - name: "tests [frontend]" - working_directory: "./frontend" - command: | - yarn install - yarn test - - environment: - PATH: /usr/local/nodejs/bin/:/usr/local/bin:/bin:/usr/bin - NODE_OPTIONS: --max-old-space-size=4096 - - save_cache: paths: - ~/.m2 diff --git a/.clj-kondo/config.edn b/.clj-kondo/config.edn index d816e47c0..0c1db4d05 100644 --- a/.clj-kondo/config.edn +++ b/.clj-kondo/config.edn @@ -25,9 +25,9 @@ :output {:exclude-files ["data_readers.clj" - "frontend/src/app/util/perf.cljs" - "common/src/app/common/logging.cljc" - "common/src/app/common/exceptions.cljc" + "src/app/util/perf.cljs" + "src/app/common/logging.cljc" + "src/app/common/exceptions.cljc" "^(?:backend|frontend|exporter|common)/build.clj" "^(?:backend|frontend|exporter|common)/deps.edn" "^(?:backend|frontend|exporter|common)/scripts/" diff --git a/backend/package.json b/backend/package.json index 1ae497ac0..18b183c3a 100644 --- a/backend/package.json +++ b/backend/package.json @@ -20,6 +20,7 @@ }, "scripts": { "fmt:clj:check": "cljfmt check --parallel=false src/ test/", - "fmt:clj": "cljfmt fix --parallel=true src/ test/" + "fmt:clj": "cljfmt fix --parallel=true src/ test/", + "lint:clj": "clj-kondo --parallel --lint src/" } } diff --git a/common/package.json b/common/package.json index 70949b1e7..c76fccbb9 100644 --- a/common/package.json +++ b/common/package.json @@ -22,6 +22,7 @@ "scripts": { "fmt:clj:check": "cljfmt check --parallel=false src/ test/", "fmt:clj": "cljfmt fix --parallel=true src/ test/", + "lint:clj": "clj-kondo --parallel --lint src/", "test:watch": "clojure -M:dev:shadow-cljs watch test", "test:compile": "clojure -M:dev:shadow-cljs compile test --config-merge '{:autorun false}'", "test:run": "node target/test.js", diff --git a/exporter/package.json b/exporter/package.json index 026ba16c4..ad5670e6a 100644 --- a/exporter/package.json +++ b/exporter/package.json @@ -27,6 +27,7 @@ }, "scripts": { "fmt:clj:check": "cljfmt check --parallel=false src/", - "fmt:clj": "cljfmt fix --parallel=true src/" + "fmt:clj": "cljfmt fix --parallel=true src/", + "lint:clj": "clj-kondo --parallel --lint src/" } } diff --git a/frontend/package.json b/frontend/package.json index 6faa22afe..d2ac50f09 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -20,7 +20,8 @@ "fmt:clj": "cljfmt fix --parallel=true src/ test/", "test:compile": "clojure -M:dev:shadow-cljs compile test --config-merge '{:autorun false}'", "lint:scss": "yarn run prettier -c resources/styles -c src/**/*.scss", - "lint:fix": "yarn run prettier -c resources/styles -c src/**/*.scss -w", + "lint:scss:fix": "yarn run prettier -c resources/styles -c src/**/*.scss -w", + "lint:clj": "clj-kondo --parallel --lint src/", "test:run": "node target/tests.js", "test:watch": "clojure -M:dev:shadow-cljs watch test", "test": "yarn run test:compile && yarn run test:run",