-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor modernizations: CI, Clojure version, test organization (#182)
* Clean up test ns structure * Upgrade to Clojure 1.11 * Fix broken test helper (and thus a failing test) * Add basic CI * Fix Java setup on CI
- Loading branch information
1 parent
e8a8524
commit 477df0b
Showing
11 changed files
with
79 additions
and
39 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,31 @@ | ||
name: Tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
build-clj: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: "Setup Java 17" | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '17' | ||
- name: Setup Clojure | ||
uses: DeLaGuardo/[email protected] | ||
with: | ||
lein: 2.10.0 | ||
- name: Cache dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.m2/repository | ||
key: "m2-${{ hashFiles('project.clj') }}" | ||
- name: Run tests | ||
run: lein test |
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,7 @@ | ||
(ns marginalia.core-test | ||
(:require | ||
[clojure.test :refer :all] | ||
[marginalia.core :as core])) | ||
|
||
(deftest parse-project-file-simple | ||
(is (= "project-name" (:name (marginalia.core/parse-project-file "test/marginalia/resources/multi-def-project.clj.txt"))))) |
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,14 @@ | ||
(ns marginalia.multidoc-test | ||
(:require | ||
[clojure.test :refer :all] | ||
[marginalia.core :as core] | ||
[marginalia.test.helpers :refer :all])) | ||
|
||
(deftest multi-page-test | ||
(with-project "multi_page" | ||
(fn [source-dir output-dir metadata] | ||
(core/multidoc! output-dir | ||
(find-clojure-file-paths source-dir) | ||
metadata)) | ||
|
||
(is (= 3 number-of-generated-pages)))) |
7 changes: 4 additions & 3 deletions
7
test/marginalia/test/parse.clj → test/marginalia/parse_test.clj
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
File renamed without changes.
This file was deleted.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,15 @@ | ||
(ns marginalia.uberdoc-test | ||
(:require | ||
[clojure.java.io :as io] | ||
[clojure.test :refer :all] | ||
[marginalia.core :as core] | ||
[marginalia.test.helpers :refer :all])) | ||
|
||
(deftest single-page-test | ||
(with-project "single_page" | ||
(fn [source-dir output-dir metadata] | ||
(marginalia.core/uberdoc! (io/file output-dir "index.html") | ||
(find-clojure-file-paths source-dir) | ||
metadata)) | ||
|
||
(is (= 1 number-of-generated-pages)))) |