Skip to content

Commit

Permalink
Fix DeLaGuardo/setup-graalvm detector to support v4.0 #70
Browse files Browse the repository at this point in the history
  • Loading branch information
liquidz committed Mar 29, 2021
1 parent feaec14 commit 5921a56
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/antq/dep/github_action/third_party.clj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@

(defmethod detect "DeLaGuardo/setup-graalvm"
[form]
(when-let [v (get-in form [:with :graalvm-version])]
(when-let [v (or
;; before v4.0
(get-in form [:with :graalvm-version])
;; v4.0 or later
(get-in form [:with :graalvm]))]
[(u.dep/normalize-by-name
(r/map->Dependency
{:name "graalvm/graalvm-ce-builds"
Expand Down
14 changes: 10 additions & 4 deletions test/antq/dep/github_action/third_party_test.clj
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,16 @@
:with {:version "1.0.0"}}))))

(t/deftest detect-setup-graalvm-test
(t/is (= [(git-tag-dependency {:name "graalvm/graalvm-ce-builds"
:version "19.3.0"})]
(sut/detect {:uses "DeLaGuardo/setup-graalvm@main"
:with {:graalvm-version "19.3.0.java8"}}))))
(t/testing "before v4.0"
(t/is (= [(git-tag-dependency {:name "graalvm/graalvm-ce-builds"
:version "19.3.0"})]
(sut/detect {:uses "DeLaGuardo/setup-graalvm@main"
:with {:graalvm-version "19.3.0.java8"}}))))
(t/testing "v4.0 or later"
(t/is (= [(git-tag-dependency {:name "graalvm/graalvm-ce-builds"
:version "19.3.0"})]
(sut/detect {:uses "DeLaGuardo/setup-graalvm@main"
:with {:graalvm "19.3.0.java8"}})))))

(t/deftest detect-setup-cljstyle-test
(t/is (= [(git-tag-dependency {:name "greglook/cljstyle"
Expand Down

0 comments on commit 5921a56

Please sign in to comment.