Skip to content

Instantly share code, notes, and snippets.

@miguno
Last active June 2, 2025 09:09
Show Gist options
  • Save miguno/dcbe231b79f66d9bfe09236095a07a79 to your computer and use it in GitHub Desktop.
Save miguno/dcbe231b79f66d9bfe09236095a07a79 to your computer and use it in GitHub Desktop.
clojure-ci.yml
name: CI
on:
push:
branches: ["main"]
pull_request:
branches: ["main"]
# To cancel a currently running workflow from the same PR, branch, or tag
# when a new workflow is triggered.
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest] # or: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Java
uses: actions/setup-java@v4
with:
java-version: '24'
distribution: 'temurin'
- name: Install clojure tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.12.0.1530
bb: 1.12.200
clj-kondo: 2025.04.07
cljfmt: 0.13.1
- name: Cache clojure dependencies
uses: actions/cache@v4 # https://github.com/actions/cache
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
.cpcache
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
restore-keys: cljdeps-
- name: Print java version
run: java -version
- name: Print clojure version
run: clojure --version
- name: Print babashka version
run: bb --version
- name: Print clj-kondo version
run: clj-kondo --version
- name: Print cljfmt version
run: cljfmt --version
- name: Lint the sources with clj-kondo
run: clojure -M:lint/clj-kondo
- name: Lint the sources with splint
run: clojure -M:lint/splint
- name: Run tests
run: clojure -M:test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment