-
-
Notifications
You must be signed in to change notification settings - Fork 26
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 #249 from liquidz/dev
Next release
- Loading branch information
Showing
17 changed files
with
238 additions
and
98 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
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,3 +1,12 @@ | ||
(ns antq.constant.github-action) | ||
|
||
(def type-key ::type) | ||
|
||
(def setup-clojure-name "clojure/brew-install") | ||
(def setup-leiningen-name "technomancy/leiningen") | ||
(def setup-boot-name "boot-clj/boot") | ||
(def setup-babashka-name "babashka/babashka") | ||
(def setup-clj-kondo-name "clj-kondo/clj-kondo") | ||
(def setup-cljfmt-name "weavejester/cljfmt") | ||
(def setup-cljstyle-name "greglook/cljstyle") | ||
(def setup-zprint-name "zprint/zprint") |
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 |
---|---|---|
|
@@ -30,4 +30,3 @@ | |
(sut/warning "WARNING") | ||
(str sw))] | ||
(t/is (= "WARNING\n" warn-str))))) | ||
|
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 |
---|---|---|
|
@@ -57,4 +57,3 @@ | |
(slurp)) | ||
upgraded (upgrade/upgrader dummy-excluded-dep)] | ||
(t/is (= original upgraded)))) | ||
|
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 |
---|---|---|
|
@@ -35,4 +35,3 @@ | |
:sha {:- "bc28de64fb36b395da4267e8d7916d1a9e167bcd" | ||
:+ "9876543"}}} | ||
(h/diff-deps from-deps to-deps)))))) | ||
|
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,89 @@ | ||
(ns antq.upgrade.github-action.third-party | ||
(:require | ||
[antq.constant.github-action :as const.gh-action] | ||
[antq.dep.github-action :as dep.gha] | ||
[antq.record :as r] | ||
[antq.test-helper :as h] | ||
[antq.upgrade :as upgrade] | ||
[antq.upgrade.github-action] | ||
[clojure.java.io :as io] | ||
[clojure.test :as t])) | ||
|
||
(defn- map->Dependency | ||
[m] | ||
(-> (merge {:project :github-action | ||
:type :github-tag | ||
:latest-version "9.0.0" | ||
:file (io/resource "dep/third-party/setup-clojure.yml") | ||
:extra {const.gh-action/type-key "DeLaGuardo/setup-clojure"}} | ||
m) | ||
(r/map->Dependency))) | ||
|
||
(defn upgrading-diff | ||
[dep] | ||
(let [from-deps (->> (:file dep) | ||
(slurp) | ||
(dep.gha/extract-deps "")) | ||
to-deps (->> (upgrade/upgrader dep) | ||
(dep.gha/extract-deps ""))] | ||
(h/diff-deps from-deps to-deps))) | ||
|
||
(t/deftest upgrade-setup-clojure-dep-test | ||
(t/testing "Clojure CLI" | ||
(t/is (= #{{:name const.gh-action/setup-clojure-name :version {:- 1 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-clojure-name :version {:- -1 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-clojure-name} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "Leiningen" | ||
(t/is (= #{{:name const.gh-action/setup-leiningen-name :version {:- 2 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-leiningen-name :version {:- -2 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-leiningen-name} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "Boot" | ||
(t/is (= #{{:name const.gh-action/setup-boot-name :version {:- 3 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-boot-name :version {:- -3 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-boot-name} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "Babashka" | ||
(t/is (= #{{:name const.gh-action/setup-babashka-name :version {:- 4 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-babashka-name :version {:- -4 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-babashka-name | ||
:type :java} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "clj-kondo" | ||
(t/is (= #{{:name const.gh-action/setup-clj-kondo-name :version {:- 5 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-clj-kondo-name :version {:- -5 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-clj-kondo-name | ||
:type :java} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "cljfmt" | ||
(t/is (= #{{:name const.gh-action/setup-cljfmt-name :version {:- 6 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-cljfmt-name :version {:- -6 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-cljfmt-name} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "cljstyle" | ||
(t/is (= #{{:name const.gh-action/setup-cljstyle-name :version {:- 7 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-cljstyle-name :version {:- -7 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-cljstyle-name} | ||
(map->Dependency) | ||
(upgrading-diff))))) | ||
|
||
(t/testing "zprint" | ||
(t/is (= #{{:name const.gh-action/setup-zprint-name :version {:- 8 :+ "9.0.0"}} | ||
{:name const.gh-action/setup-zprint-name :version {:- -8 :+ "9.0.0"}}} | ||
(-> {:name const.gh-action/setup-zprint-name | ||
:type :java} | ||
(map->Dependency) | ||
(upgrading-diff)))))) |
Oops, something went wrong.