diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..7eb8861 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,23 @@ +name: Clojure CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + strategy: + matrix: + java: [ '8', '16' ] + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + distribution: 'adopt' + java-version: ${{ matrix.java }} + cache: 'maven' + - name: Clojure CLI + uses: DeLaGuardo/setup-clojure@master + with: + cli: '1.10.3.967' + - name: Run Tests + run: clojure -T:build ci \ No newline at end of file diff --git a/.gitignore b/.gitignore index 6759ce4..74a2986 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ pom.xml.asc .cpcache/ .lsp/ .eastwood +.clj-kondo/ # IntelliJ IDEA - User-specific stuff .idea/ diff --git a/build.clj b/build.clj index f5fb422..631eae3 100644 --- a/build.clj +++ b/build.clj @@ -5,15 +5,9 @@ (def lib 'io.github.erp12/fijit) -(def lib-version (format "0.0.%s" (b/git-count-revs nil))) +(def version (format "1.0.%s" (b/git-count-revs nil))) -(defn tag - [scala-ver] - (format "%s-%s" (name scala-ver) lib-version)) - -(defn jar-file - [scala-ver] - (format "target/%s_%s.jar" (name lib) (tag scala-ver))) +(def jar-file (format "target/%s-%s.jar" (name lib) version)) (def scala-verions [:2.12 :2.13]) @@ -21,15 +15,11 @@ (defn for-scala-versions [opts f] - (doseq [scala-ver (if-let [v (:scala-version opts)] - [v] - scala-verions)] - (f (merge {:aliases [scala-ver] - :lib lib - :version lib-version - :jar-file (jar-file scala-ver) - :tag (tag scala-ver)} - opts)))) + (doseq [scala-ver (if-let [v (:scala-version opts)] + [v] + scala-verions)] + (f (merge {:aliases [scala-ver]} + opts)))) ;; Entry ;;;;;;;;;; @@ -37,10 +27,12 @@ [opts] (for-scala-versions opts bb/run-tests)) -(defn jars +(defn jar [opts] - (bb/clean opts) - (for-scala-versions opts bb/jar)) + (-> opts + (assoc :lib lib :version version) + (bb/clean) + (bb/jar))) (defn gen-docs [_] @@ -52,12 +44,12 @@ (System/exit exit)))) (defn ci - "Run the CI pipeline. This runs tests and builds JARs for each Scala version." + "Run the CI pipeline. This runs tests for each Scala version and build the jar." [opts] (tests opts) - (jars opts)) + (jar opts)) (defn prepare-release [opts] (ci opts) - (gen-docs opts)) \ No newline at end of file + (gen-docs opts))