mirror of
https://github.com/metosin/reitit.git
synced 2025-12-17 08:21:11 +00:00
Update CI tests and add shadow-cljs to run cljs tests
This commit is contained in:
parent
ada41ec7dd
commit
ea88b06206
8 changed files with 1988 additions and 2663 deletions
59
.github/workflows/testsuite.yml
vendored
59
.github/workflows/testsuite.yml
vendored
|
|
@ -16,25 +16,27 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.m2/repository
|
path: ~/.m2/repository
|
||||||
key: ${{ runner.os }}-clj-${{ hashFiles('**/project.clj') }}
|
key: ${{ runner.os }}-clj-${{ hashFiles('**/project.clj') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-clj-
|
${{ runner.os }}-clj-
|
||||||
|
|
||||||
- name: Setup Java ${{ matrix.jdk }}
|
- name: Setup Java ${{ matrix.jdk }}
|
||||||
uses: actions/setup-java@v1.4.3
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
|
distribution: temurin
|
||||||
java-version: ${{ matrix.jdk }}
|
java-version: ${{ matrix.jdk }}
|
||||||
|
|
||||||
- name: Setup Clojure
|
- name: Setup Clojure
|
||||||
uses: DeLaGuardo/setup-clojure@3.1
|
uses: DeLaGuardo/setup-clojure@13.1
|
||||||
with:
|
with:
|
||||||
lein: 2.9.5
|
lein: 2.9.5
|
||||||
- name: Install dependencies
|
|
||||||
run: |
|
|
||||||
npm ci
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: ./scripts/test.sh clj
|
run: ./scripts/test.sh clj
|
||||||
|
|
||||||
|
|
@ -42,33 +44,40 @@ jobs:
|
||||||
name: ClojureScript
|
name: ClojureScript
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Cache dependencies
|
- name: Cache dependencies
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
~/.m2/repository
|
~/.m2/repository
|
||||||
**/node_modules
|
key: ${{ runner.os }}-cljs-${{ hashFiles('**/project.clj') }}
|
||||||
key: ${{ runner.os }}-cljs-${{ hashFiles('**/project.clj', '**/package-lock.json') }}
|
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cljs-
|
${{ runner.os }}-cljs-
|
||||||
- name: Setup Java 11
|
|
||||||
uses: actions/setup-java@v1.4.3
|
- name: Setup Java
|
||||||
|
uses: actions/setup-java@v4
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
distribution: temurin
|
||||||
|
java-version: 21
|
||||||
|
|
||||||
- name: Setup Clojure
|
- name: Setup Clojure
|
||||||
uses: DeLaGuardo/setup-clojure@3.1
|
uses: DeLaGuardo/setup-clojure@13.1
|
||||||
with:
|
with:
|
||||||
lein: 2.9.5
|
lein: 2.9.5
|
||||||
|
|
||||||
- name: Setup Node.js
|
- name: Setup Node.js
|
||||||
uses: actions/setup-node@v2.1.2
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: 18
|
node-version: 22
|
||||||
|
cache: npm
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: npm ci
|
||||||
npm ci
|
|
||||||
- name: Install modules
|
# - name: Install modules
|
||||||
run: ./scripts/lein-modules install
|
# run: ./scripts/lein-modules install
|
||||||
|
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: ./scripts/test.sh cljs
|
run: ./scripts/test.sh cljs
|
||||||
|
|
||||||
|
|
@ -76,7 +85,8 @@ jobs:
|
||||||
name: Lint cljdoc.edn
|
name: Lint cljdoc.edn
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Verify cljdoc.edn
|
- name: Verify cljdoc.edn
|
||||||
run: curl -fsSL https://raw.githubusercontent.com/cljdoc/cljdoc/master/script/verify-cljdoc-edn | bash -s doc/cljdoc.edn
|
run: curl -fsSL https://raw.githubusercontent.com/cljdoc/cljdoc/master/script/verify-cljdoc-edn | bash -s doc/cljdoc.edn
|
||||||
|
|
||||||
|
|
@ -84,13 +94,16 @@ jobs:
|
||||||
name: Check cljdoc analysis
|
name: Check cljdoc analysis
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Setup Clojure
|
- name: Setup Clojure
|
||||||
uses: DeLaGuardo/setup-clojure@11.0
|
uses: DeLaGuardo/setup-clojure@13.1
|
||||||
with:
|
with:
|
||||||
lein: 2.9.5
|
lein: 2.9.5
|
||||||
cli: 1.11.0.1100
|
cli: 1.11.0.1100
|
||||||
|
|
||||||
- name: Install cljdoc analyzer
|
- name: Install cljdoc analyzer
|
||||||
run: clojure -Ttools install io.github.cljdoc/cljdoc-analyzer '{:git/tag "RELEASE"}' :as cljdoc-analyzer
|
run: clojure -Ttools install io.github.cljdoc/cljdoc-analyzer '{:git/tag "RELEASE"}' :as cljdoc-analyzer
|
||||||
|
|
||||||
- name: CljDoc Check
|
- name: CljDoc Check
|
||||||
run: ./scripts/cljdoc-check.sh
|
run: ./scripts/cljdoc-check.sh
|
||||||
|
|
|
||||||
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -14,3 +14,4 @@ pom.xml.asc
|
||||||
figwheel_server.log
|
figwheel_server.log
|
||||||
/.idea
|
/.idea
|
||||||
.clj-kondo
|
.clj-kondo
|
||||||
|
.shadow-cljs
|
||||||
|
|
|
||||||
20
karma.conf.js
Normal file
20
karma.conf.js
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
module.exports = function (config) {
|
||||||
|
config.set({
|
||||||
|
browsers: ['ChromeHeadless'],
|
||||||
|
// The directory where the output file lives
|
||||||
|
basePath: 'target/karma',
|
||||||
|
// The file itself
|
||||||
|
files: ['ci.js'],
|
||||||
|
frameworks: ['cljs-test'],
|
||||||
|
plugins: ['karma-cljs-test', 'karma-chrome-launcher'],
|
||||||
|
colors: true,
|
||||||
|
logLevel: config.LOG_INFO,
|
||||||
|
client: {
|
||||||
|
args: ["shadow.test.karma.init"],
|
||||||
|
singleRun: true
|
||||||
|
},
|
||||||
|
junitReporter: {
|
||||||
|
outputDir: "target/results/cljs"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
};
|
||||||
4516
package-lock.json
generated
4516
package-lock.json
generated
File diff suppressed because it is too large
Load diff
11
package.json
11
package.json
|
|
@ -2,11 +2,14 @@
|
||||||
"name": "reitit",
|
"name": "reitit",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@seriousme/openapi-schema-validator": "^2.2.1",
|
"@seriousme/openapi-schema-validator": "^2.3.1",
|
||||||
"karma": "^4.1.0",
|
"karma": "^6.4.4",
|
||||||
"karma-chrome-launcher": "^2.2.0",
|
"karma-chrome-launcher": "^3.2.0",
|
||||||
"karma-cli": "^2.0.0",
|
"karma-cli": "^2.0.0",
|
||||||
"karma-cljs-test": "^0.1.0",
|
"karma-cljs-test": "^0.1.0",
|
||||||
"karma-junit-reporter": "^1.2.0"
|
"karma-junit-reporter": "^2.0.1"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"shadow-cljs": "^2.28.20"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,6 +89,7 @@
|
||||||
:java-source-paths ["modules/reitit-core/java-src"]
|
:java-source-paths ["modules/reitit-core/java-src"]
|
||||||
|
|
||||||
:dependencies [[org.clojure/clojure "1.11.4"]
|
:dependencies [[org.clojure/clojure "1.11.4"]
|
||||||
|
[thheller/shadow-cljs "2.28.20"]
|
||||||
[org.clojure/clojurescript "1.11.132"]
|
[org.clojure/clojurescript "1.11.132"]
|
||||||
|
|
||||||
;; modules dependencies
|
;; modules dependencies
|
||||||
|
|
@ -128,6 +129,7 @@
|
||||||
[ring-cors "0.1.13"]
|
[ring-cors "0.1.13"]
|
||||||
|
|
||||||
[com.bhauman/rebel-readline "0.1.4"]]}
|
[com.bhauman/rebel-readline "0.1.4"]]}
|
||||||
|
:shadow {:test-paths ["test/cljs"]}
|
||||||
:perf {:jvm-opts ^:replace ["-server"
|
:perf {:jvm-opts ^:replace ["-server"
|
||||||
"-Xmx4096m"
|
"-Xmx4096m"
|
||||||
"-Dclojure.compiler.direct-linking=true"]
|
"-Dclojure.compiler.direct-linking=true"]
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,11 @@
|
||||||
set -e
|
set -e
|
||||||
case $1 in
|
case $1 in
|
||||||
cljs)
|
cljs)
|
||||||
lein "do" test-browser once, test-node once, test-advanced once
|
npx shadow-cljs compile node-test
|
||||||
|
node target/shadow-node-test/node-tests.js
|
||||||
|
|
||||||
|
npx shadow-cljs compile karma
|
||||||
|
npx karma start --single-run
|
||||||
;;
|
;;
|
||||||
clj)
|
clj)
|
||||||
lein test-clj
|
lein test-clj
|
||||||
|
|
|
||||||
20
shadow-cljs.edn
Normal file
20
shadow-cljs.edn
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
{:lein {:profile "+shadow"}
|
||||||
|
;; tests are served via http://localhost:8021
|
||||||
|
:dev-http {8021 "target/shadow-browser-test"}
|
||||||
|
|
||||||
|
:builds
|
||||||
|
{:node-test
|
||||||
|
{:target :node-test
|
||||||
|
:output-to "target/shadow-node-test/node-tests.js"
|
||||||
|
:ns-regexp "-test"
|
||||||
|
;; Watch will also run the tests
|
||||||
|
:autorun true}
|
||||||
|
|
||||||
|
:browser-test
|
||||||
|
{:target :browser-test
|
||||||
|
:test-dir "target/shadow-browser-test"}
|
||||||
|
|
||||||
|
:karma
|
||||||
|
{:target :karma
|
||||||
|
:output-to "target/karma/ci.js"
|
||||||
|
:ns-regexp "-test$"}}}
|
||||||
Loading…
Reference in a new issue