-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
92 additions
and
10 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,51 @@ | ||
name: Example workflow | ||
|
||
on: [push] | ||
|
||
jobs: | ||
|
||
clojure: | ||
|
||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macOS-latest, windows-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/setup-clojure@10.0 | ||
with: | ||
bb: 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: Test Clojure | ||
run: bb test:jvm | ||
|
||
- name: Test bb | ||
run: bb test:bb |
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,2 +1,3 @@ | ||
.cache | ||
.cpcache | ||
test/out |
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 |
---|---|---|
@@ -1 +1,3 @@ | ||
{:paths ["src"]} | ||
{:paths ["src"] | ||
:deps {clj-kondo/clj-kondo {:mvn/version "2022.10.05"}} | ||
:tools/usage {:ns-default quickdoc.api}} |
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,4 +1,2 @@ | ||
{:deps {;; only necessary for JVM usage - use :exclusions [clj-kondo/clj-kondo] | ||
io.github.borkdude/quickdoc-sources {:local/root ".."} | ||
clj-kondo/clj-kondo {:mvn/version "2022.10.05"}} | ||
{:deps {io.github.borkdude/quickdoc-sources {:local/root ".."}} | ||
:tools/usage {:ns-default quickdoc.api}} |
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,5 @@ | ||
(ns source) | ||
|
||
(defn foo | ||
"Hello" | ||
[]) |
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,16 @@ | ||
(ns quickdoc.api-test | ||
(:require | ||
[clojure.string :as str] | ||
[clojure.test :as t :refer [deftest is testing]] | ||
[quickdoc.api :as api])) | ||
|
||
(deftest foo-test | ||
(testing "source link template" | ||
(api/quickdoc {:git/branch "main" | ||
:source-uri "https://dev.azure.com/company/_git/project?path={filename}&version=GBmain&_a=contents&line={row}&lineEnd={end-row}&lineStartColumn={col}&lineEndColumn={end-col}&lineStyle=plain" | ||
:toc true | ||
:source-paths ["test-resources/source.clj"] | ||
:outfile "test/out/API.md"}) | ||
(let [out (slurp "test/out/API.md")] | ||
(is (str/includes? out | ||
"https://dev.azure.com/company/_git/project?path=test-resources/source.clj&version=GBmain&_a=contents&line=3&lineEnd=5&lineStartColumn=1&lineEndColumn=6&lineStyle=plain"))))) |
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,9 @@ | ||
(ns runner | ||
(:require | ||
[clojure.test] | ||
[quickdoc.api-test])) | ||
|
||
(defn run-tests [_] | ||
(let [{:keys [fail error]} (clojure.test/run-tests 'quickdoc.api-test)] | ||
(when (pos? (+ fail error)) | ||
(System/exit 1)))) |