-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from liquidz/dev
ver 0.3.0
- Loading branch information
Showing
27 changed files
with
428 additions
and
70 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,25 @@ | ||
name: coverage | ||
on: push | ||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
# container: | ||
# image: clojure:openjdk-14-tools-deps | ||
steps: | ||
- uses: actions/checkout@v2.1.0 | ||
- name: Install clojure | ||
run: | | ||
curl -O https://download.clojure.org/install/linux-install-1.10.1.536.sh | ||
chmod +x linux-install-1.10.1.536.sh | ||
sudo ./linux-install-1.10.1.536.sh | ||
- name: Cache m2 | ||
uses: actions/cache@v1.1.2 | ||
with: | ||
path: /root/.m2 | ||
key: root-m2-${{ hashFiles('deps.edn') }} | ||
- name: Run cloverage | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
bash script/coverage.sh | ||
bash <(curl -s https://codecov.io/bash) |
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
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,3 @@ | ||
#!/bin/bash | ||
|
||
clojure -A:dev:coverage --src-ns-path=src --test-ns-path=test --codecov |
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
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
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,7 +1,23 @@ | ||
(ns antq.ver) | ||
(ns antq.ver | ||
(:require | ||
[clojure.string :as str])) | ||
|
||
(defmulti get-latest-version :type) | ||
(def ^:private under-development-keywords | ||
#{"alpha" "beta" "rc"}) | ||
|
||
(defmethod get-latest-version :default | ||
(defn under-devleopment? | ||
[s] | ||
(if-let [l (and s (str/lower-case s))] | ||
(some? (some #(str/includes? l %) under-development-keywords)) | ||
false)) | ||
|
||
(defn snapshot? | ||
[s] | ||
(if s | ||
(str/includes? (str/lower-case s) "snapshot") | ||
false)) | ||
|
||
(defmulti get-sorted-versions :type) | ||
(defmethod get-sorted-versions :default | ||
[dep] | ||
(throw (ex-info "Unknown dependency type" dep))) |
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,32 +1,29 @@ | ||
(ns antq.ver.github-action | ||
(:require | ||
[antq.util.ver :as u.ver] | ||
[antq.util.xml :as u.xml] | ||
[antq.ver :as ver] | ||
[clojure.data.xml :as xml] | ||
[cheshire.core :as json] | ||
[clojure.string :as str] | ||
[version-clj.core :as version])) | ||
|
||
(defn releases-atom | ||
(defn tag-api-url | ||
[dep] | ||
(format "https://github.com/%s/releases.atom" | ||
(format "https://api.github.com/repos/%s/tags" | ||
(str/join "/" (take 2 (str/split (:name dep) #"/"))))) | ||
|
||
(defn get-latest-version-by-url* | ||
(defn get-sorted-versions-by-url* | ||
[url] | ||
(->> url | ||
slurp | ||
xml/parse-str | ||
xml-seq | ||
(filter (comp #{:entry} :tag)) | ||
(map #(u.ver/normalize-version (u.xml/get-value (:content %) :title))) | ||
(filter u.ver/sem-ver?) | ||
(sort version/version-compare) | ||
last)) | ||
(-> url | ||
slurp | ||
(json/parse-string true) | ||
(->> (map (comp u.ver/normalize-version :name)) | ||
(filter u.ver/sem-ver?) | ||
(sort version/version-compare) | ||
reverse))) | ||
|
||
(def get-latest-version-by-url | ||
(memoize get-latest-version-by-url*)) | ||
(def get-sorted-versions-by-url | ||
(memoize get-sorted-versions-by-url*)) | ||
|
||
(defmethod ver/get-latest-version :github-action | ||
(defmethod ver/get-sorted-versions :github-action | ||
[dep] | ||
(-> dep releases-atom get-latest-version-by-url)) | ||
(-> dep tag-api-url get-sorted-versions-by-url)) |
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
Oops, something went wrong.