-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Run tests with new CLJS on Github Actions (#70)
- Loading branch information
Showing
9 changed files
with
105 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: ci | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
|
||
clojure: | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest] | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
# It is important to install java before installing clojure tools which needs java | ||
# exclusions: babashka, clj-kondo and cljstyle | ||
- name: Prepare java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: '8' | ||
|
||
- name: Install clojure tools | ||
uses: DeLaGuardo/[email protected] | ||
with: | ||
bb: latest | ||
lein: latest | ||
# Optional step: | ||
- name: Cache clojure dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: | | ||
~/.m2/repository | ||
~/.gitlibs | ||
~/.deps.clj | ||
# List all files containing dependencies: | ||
key: cljdeps-${{ hashFiles('deps.edn') }} | ||
# key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }} | ||
# key: cljdeps-${{ hashFiles('project.clj') }} | ||
# key: cljdeps-${{ hashFiles('build.boot') }} | ||
restore-keys: cljdeps- | ||
|
||
- name: Execute clj tests | ||
run: bb test:clj | ||
|
||
- name: Execute cljs tests | ||
run: | | ||
bb test:cljs-npm-install | ||
bb test:cljs | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,7 @@ pom.xml | |
out/ | ||
.cpcache | ||
.cache | ||
cljs-test-runner-out | ||
node_modules | ||
|
||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
{:deps {io.github.borkdude/lein2deps {:git/url "https://github.com/borkdude/lein2deps" | ||
:git/sha "e26edeb114c9d88a5c4d3abb683306588fcaad13"}} | ||
:tasks {lein2deps {:doc "Generate deps.edn from project.clj" | ||
:requires ([lein2deps.api :as lein2deps]) | ||
:task (lein2deps/lein2deps {:write-file "deps.edn"})}} } | ||
:tasks | ||
{:requires ([babashka.fs :as fs]) | ||
|
||
test:clj (shell "lein test") | ||
|
||
test:cljs-npm-install (do (shell "npm install -g karma-cli") | ||
(shell "npm install")) | ||
test:cljs (do | ||
(fs/delete-tree "cljs-test-runner-out") | ||
(apply clojure "-M:test:cljs:cljs-test-runner" "--env" "chrome-headless" *command-line-args*)) | ||
repl:cljs-node (shell "rlwrap bb clojure -M:test:cljs -m cljs.main -re node") | ||
repl:cljs-browser (shell "rlwrap bb clojure -M:test:cljs -m cljs.main")}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"devDependencies": { | ||
"karma": "^6.4.1", | ||
"karma-chrome-launcher": "^3.1.1", | ||
"karma-cli": "^2.0.0", | ||
"karma-cljs-test": "^0.1.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters