-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (62 loc) · 2.63 KB
/
Copy pathcommit_validation.yml
File metadata and controls
62 lines (62 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Commit validation
on:
push:
branches: '**'
# This setup to commit on commit only - as the check is not tag dependant --> https://stackoverflow.com/questions/64708371/how-to-run-github-workflow-on-every-commit-of-a-push
# When the commit is rebase, it is most often creating a new predecessor so a new commit sha. It is made on purpose to test this again, in case the rebasing automatic conflict resolution would create something harmful
jobs:
clojure:
permissions:
contents: read
strategy:
matrix:
os: [ubuntu-latest] # , windows-latest There is a path issue
# macOS-latest is removed to save github costs
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: /home/runner/.m2/repository
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn') }}
restore-keys: cljdeps-
- name: Install java
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '22'
- name: Install clojure tools
# See https://github.com/DeLaGuardo/setup-clojure/commits/main/
uses: DeLaGuardo/setup-clojure@cc67f8308550d0f18b0ba445c2476f84626a5d6a #v13.0
with:
cli: 1.12.0.1479 # Clojure CLI based on tools.deps
bb: 1.12.195 # Babashka
clj-kondo: 2024.11.14 # Clj-kondo
zprint: 1.2.9 # zprint
- name: Lint
run: bb lint -v
- name: Setup zprint
run: echo "{:search-config? true}" >> ~/.zprintrc
- name: Install fdfind
run: sudo rm /var/lib/man-db/auto-update && sudo apt-get install -y fd-find && mkdir -p ~/.local/bin/ && PATH=$PATH:~/.local/bin/ && ln -s $(which fdfind) ~/.local/bin/fd
- name: format again to check the code pushed was uptodate
run: bb format -v
- name: Write git diff - show what has been changed by zprint
run: git diff
- name: Pushed code should already be formatted
# See https://github.com/CatChen/check-git-status-action
uses: CatChen/check-git-status-action@bde80484b437cece974f79da735a5cd1dfdc9b0b #v1
with:
fail-if-not-clean: true
request-changes-if-not-clean: false
push-if-not-clean: false
- name: test code in clojure
run: bb clj-test test-clj -v
- name: test code in clojurescript
run: bb cljs-node-test all -v
- name: print infos just for debugging, and the logs
run: bb heph-info