Skip to content

Commit

Permalink
Merge pull request #1 from SovereignShop/pipeline-setup
Browse files Browse the repository at this point in the history
Create Pipeline
  • Loading branch information
cartesian-theatrics authored Apr 4, 2024
2 parents 712118e + 2e87ba0 commit 369c387
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 24 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Clojure Tests

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
test:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'

- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.11.2.1446 # Clojure CLI based on tools.deps
clj-kondo: 2022.05.31
cljfmt: 0.10.2
cljstyle: 0.15.0
cmd-exe-workaround: 'latest'
zprint: 1.2.3

- name: Cache clojure dependencies
uses: actions/cache@v3
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
key: cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: cljdeps-

- name: Install libassimp
run: sudo apt-get update && sudo apt-get install -y libassimp-dev

- name: Run tests
run: clojure -M:dev:test
6 changes: 5 additions & 1 deletion deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
:deps {net.mikera/core.matrix {:mvn/version "0.62.0"}
;; org.clojars.cartesiantheatrics/clj-manifold3d {:local/root "../clj-manifold3d"}
org.clojars.cartesiantheatrics/clj-manifold3d {:mvn/version "0.0.18"}
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}
net.mikera/vectorz-clj {:mvn/version "0.48.0"}
metosin/malli {:mvn/version "0.11.0"}
scad-clj/scad-clj {:mvn/version "0.5.3"}}
Expand All @@ -11,6 +10,11 @@
{:extra-deps
{org.clojars.cartesiantheatrics/manifold3d$linux-x86_64 {:mvn/version "1.0.77"}}}

:test {:extra-paths ["test/main"]
:extra-deps {lambdaisland/kaocha {:mvn/version "1.88.1376"}
org.clojure/clojure {:mvn/version "1.11.2"}}
:main-opts ["-m" "kaocha.runner"]}

:deploy
{:extra-paths ["build"]
:extra-deps {badigeon/badigeon {:mvn/version "1.7"}
Expand Down
10 changes: 5 additions & 5 deletions src/main/plexus/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
(:refer-clojure :exclude [set])
(:require
[clojure.java.io :as io]
[plexus.utils :as u]
[plexus.schema :as schema :refer [validate-form]]
[plexus.transforms :as tf]
[clj-manifold3d.core :as m]
[malli.core :as ma]
[plexus.impl :as impl])
[plexus.impl :as impl]
[clojure.repl :refer [demunge]]
[clojure.string :as s])
(:import
[plexus.impl Form]))

Expand All @@ -16,10 +16,10 @@
(cond (vector? fn-object)
(into [(first fn-object)] (map pretty-demunge (subvec fn-object 1)))
:else
(let [dem-fn (clojure.repl/demunge (str fn-object))
(let [dem-fn (demunge (str fn-object))
pretty (second (re-find #"(.*?\/.*?)(--\d+)?[@].*" dem-fn))]
(symbol
(if pretty (peek (clojure.string/split pretty #"/")) dem-fn)))))
(if pretty (peek (s/split pretty #"/")) dem-fn)))))


(defn- get-map-key-schemas [schema]
Expand Down
19 changes: 1 addition & 18 deletions src/test/plexus/core_test.clj → test/main/plexus/core_test.clj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(ns plexus.core_test
(ns plexus.core-test
(:require
[clj-manifold3d.core :as m]
[clojure.test :as t]
Expand All @@ -14,7 +14,6 @@

(def pi Math/PI)
(def pi|2 (/ pi 2))
(def pi|2 (/ pi 2))
(def pi|3 (/ pi 3))
(def pi|4 (/ pi 4))
(def pow #(Math/pow %1 %2))
Expand Down Expand Up @@ -61,19 +60,3 @@
1 (p/right :angle pi|2)
2 (p/up :angle pi|2)
3 (p/down :angle pi|2))))))))))


(t/deftest test-hull)

(t/deftest test-loft)

(t/deftest test-translate)

(t/deftest test-rotate)

(t/deftest test-offset)

(t/deftest test-insert)

(t/deftest test-)
(test-extrudes)
1 change: 1 addition & 0 deletions tests.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#kaocha/v1 {:test-paths "test/main"}

0 comments on commit 369c387

Please sign in to comment.