-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (67 loc) · 2.56 KB
/
Copy pathcommit_validation.yml
File metadata and controls
67 lines (67 loc) · 2.56 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
63
64
65
66
67
# V1 - For all projects
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@v5
with:
fetch-depth: 0
- name: Install java
uses: actions/setup-java@v5
with:
distribution: 'temurin'
java-version: '21'
check-latest: true
- name: Install clojure tools
# See https://github.com/DeLaGuardo/setup-clojure/commits/main/
uses: DeLaGuardo/setup-clojure@3fe9b3ae632c6758d0b7757b0838606ef4287b08 #v13.2
with:
cli: 1.12.3.1577
bb: 1.12.209
clj-kondo: 2025.10.23
zprint: 1.3.0
- name: Lint
run: bb lint -v
- name: Setup zprint
run: echo "{:search-config? true}" >> ~/.zprintrc
- name: Install fd-find
run: |
sudo apt-get update
sudo apt-get install -y fd-find
mkdir -p ~/.local/bin
ln -s "$(which fdfind)" ~/.local/bin/fd
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Cache clojure dependencies
uses: actions/cache@v4
with:
path: /home/runner/.m2/repository
key: cljdeps-${{ hashFiles('deps.edn', 'bb.edn', '.github/workflows/commit_validation.yml') }}
restore-keys: cljdeps-
- 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@d75bdbea704869e2a3b01111b4a82c49e9bd348d #v1.4.4
with:
fail-if-not-clean: true
request-changes-if-not-clean: false
push-if-not-clean: false
- name: test
run: bb gha
- name: print infos just for debugging, and the logs
run: bb heph-info