Skip to content

Commit

Permalink
test & ci: bump deps (#322)
Browse files Browse the repository at this point in the history
Of note:
- codecov action renamed arg file->files
- setup-clojure action now installs via clj-msi on Windows (woot!)
- new version of kondo; it found a couple of redundant nested calls (fixed)!
- bump lib tests libs
- add jdk23 to ci testing
  • Loading branch information
lread authored Nov 14, 2024
1 parent 9a6bc04 commit b8a4804
Show file tree
Hide file tree
Showing 14 changed files with 144 additions and 116 deletions.
6 changes: 5 additions & 1 deletion .clj-kondo/taoensso/encore/config.edn
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
{:hooks {:analyze-call {taoensso.encore/defalias taoensso.encore/defalias}}}
{:hooks
{:analyze-call
{taoensso.encore/defalias taoensso.encore/defalias
taoensso.encore/defn-cached taoensso.encore/defn-cached
taoensso.encore/defonce taoensso.encore/defonce}}}
57 changes: 46 additions & 11 deletions .clj-kondo/taoensso/encore/taoensso/encore.clj
Original file line number Diff line number Diff line change
@@ -1,16 +1,51 @@
(ns taoensso.encore
"I don't personally use clj-kondo, so these hooks are
kindly authored and maintained by contributors.
PRs very welcome! - Peter Taoussanis"
(:refer-clojure :exclude [defonce])
(:require
[clj-kondo.hooks-api :as hooks]))

(defn defalias [{:keys [node]}]
(defn defalias
[{:keys [node]}]
(let [[sym-raw src-raw] (rest (:children node))
src (if src-raw src-raw sym-raw)
sym (if src-raw
sym-raw
(symbol (name (hooks/sexpr src))))]
{:node (with-meta
(hooks/list-node
[(hooks/token-node 'def)
(hooks/token-node (hooks/sexpr sym))
(hooks/token-node (hooks/sexpr src))])
(meta src))}))
src (or src-raw sym-raw)
sym (if src-raw sym-raw (symbol (name (hooks/sexpr src))))]
{:node
(with-meta
(hooks/list-node
[(hooks/token-node 'def)
(hooks/token-node (hooks/sexpr sym))
(hooks/token-node (hooks/sexpr src))])
(meta src))}))

(defn defn-cached
[{:keys [node]}]
(let [[sym _opts binding-vec & body] (rest (:children node))]
{:node
(hooks/list-node
(list
(hooks/token-node 'def)
sym
(hooks/list-node
(list*
(hooks/token-node 'fn)
binding-vec
body))))}))

(defn defonce
[{:keys [node]}]
;; args = [sym doc-string? attr-map? init-expr]
(let [[sym & args] (rest (:children node))
[doc-string args] (if (and (hooks/string-node? (first args)) (next args)) [(hooks/sexpr (first args)) (next args)] [nil args])
[attr-map init-expr] (if (and (hooks/map-node? (first args)) (next args)) [(hooks/sexpr (first args)) (fnext args)] [nil (first args)])

attr-map (if doc-string (assoc attr-map :doc doc-string) attr-map)
sym+meta (if attr-map (with-meta sym attr-map) sym)
rewritten
(hooks/list-node
[(hooks/token-node 'clojure.core/defonce)
sym+meta
init-expr])]

{:node rewritten}))
4 changes: 2 additions & 2 deletions .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
run: bb test-coverage

- name: Upload Code Coverage Results
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true # optional (default = false)
file: ./target/coverage/codecov.json
files: ./target/coverage/codecov.json
token: ${{ secrets.CODECOV_TOKEN }} # required
verbose: true # optional (default = false)
2 changes: 1 addition & 1 deletion .github/workflows/libs-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
## instead of using lein bundled with github actions image.
## Upcoming 2.11.2 might fix, can optionally revisit in the future.
- name: Install Lein
uses: DeLaGuardo/setup-clojure@12.5
uses: DeLaGuardo/setup-clojure@13.0
with:
lein: 2.10.0

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/native-image-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
fail-fast: false
matrix:
os: [ windows, ubuntu, macos ]
java-version: [ '23' ]
java-version: [ '23.0.1' ]
test: [ native, native-sci ]
clojure-version: [ '1.12' ]

Expand Down
18 changes: 2 additions & 16 deletions .github/workflows/shared-setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,25 +39,11 @@ runs:
java-version: ${{ inputs.jdk }}
if: inputs.jdk != 'skip'

- name: Install Babashka
uses: DeLaGuardo/setup-clojure@12.5
- name: Install Babashka & Clojure
uses: DeLaGuardo/setup-clojure@13.0
with:
bb: 'latest'

- name: Install Clojure (windows)
# On windows, deps.clj's deps.exe is used in place of clojure to avoid complexities of official clojure install
shell: ${{ inputs.shell }}
run: |
PowerShell -Command "iwr -useb https://raw.githubusercontent.com/borkdude/deps.clj/master/install.ps1 | iex"
Rename-Item $HOME\deps.clj\deps.exe clojure.exe
echo "$HOME\deps.clj" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: runner.os == 'Windows'

- name: Install Clojure (macos, linux)
uses: DeLaGuardo/[email protected]
with:
cli: 'latest'
if: runner.os != 'Windows'

- name: Tools Versions
shell: ${{ inputs.shell }}
Expand Down
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
lread/status-line {:git/url "https://github.com/lread/status-line.git"
:sha "cf44c15f30ea3867227fa61ceb823e5e942c707f"}
etaoin/etaoin {:mvn/version "1.1.42"}
io.github.babashka/neil {:git/tag "v0.3.67" :git/sha "054ca51"}}
io.github.babashka/neil {:git/tag "v0.3.68", :git/sha "78ffab1"} }
:tasks {;; setup
:requires ([clojure.string :as string]
[lread.status-line :as status])
Expand Down
4 changes: 2 additions & 2 deletions deps.edn
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
;;
:lint-cache {:replace-paths ["src"]} ;; when building classpath we want to exclude resources
;; so we do not pick up our own clj-kondo config exports
:clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2024.09.27"}}
:clj-kondo {:extra-deps {clj-kondo/clj-kondo {:mvn/version "2024.11.14"}}
:override-deps {org.clojure/clojure {:mvn/version "1.12.0"}}
:main-opts ["-m" "clj-kondo.main"]}

Expand Down Expand Up @@ -158,7 +158,7 @@
;;
;; Maintenance support
;;
:outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "2.9.1232"}
:outdated {:extra-deps {com.github.liquidz/antq {:mvn/version "2.11.1250"}
org.slf4j/slf4j-simple {:mvn/version "2.0.16"} ;; to rid ourselves of logger warnings
}
:override-deps {org.clojure/clojure {:mvn/version "1.12.0"}}
Expand Down
9 changes: 2 additions & 7 deletions doc/02-developer-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,8 @@ https://scoop.sh/[Scoop] offers an easy way to install tools.
@littleli is doing a great job w/maintaining https://github.com/littleli/scoop-clojure[scoop apps for Clojure, Babashka and other tools] and this is how I installed Babashka.

==== Clojure
We all choose our own paths, but for me, using https://github.com/borkdude/deps.clj[deps.clj] instead of https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows[Clojure's PowerShell Module] offered me no fuss no muss Clojure on Windows and GitHub Actions on Windows.
I decided to install deps.clj not through scoop but through https://github.com/borkdude/deps.clj#windows[the deps.clj `install.ps1` script].
This makes it simple to treat `deps.exe` as if it were the official `clojure` via a simple rename:

----
Rename-Item $HOME\deps.clj\deps.exe clojure.exe
----
Now that the Clojure core team is recommends https://github.com/casselc/clj-msi[clj-msi] life is easier.
If you are not already installing via `clj-msi` on Windows, you'll want to do so.

==== GraalVM
You'll have your own preference, but I find it convenient to install GraalVM on Windows via scoop.
Expand Down
Loading

0 comments on commit b8a4804

Please sign in to comment.