Repository navigation
76 lines (64 loc) · 2.59 KB
/
Copy pathci.yaml
File metadata and controls
76 lines (64 loc) · 2.59 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
68
69
70
71
72
73
74
75
76
name: CI
on:
push:
branches: [main]
tags: ['v[0-9]+.[0-9]+.[0-9]+']
pull_request:
branches: [main]
# Cancel in-progress runs for the same ref when a new run starts.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
test:
name: Test
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v6
# Single-user Nix install — designed for CI, ~5s vs ~30s for the
# Determinate installer, and pairs cleanly with cache-nix-action
# (which can't restore root-owned /nix from multi-user mode).
- name: Install Nix
uses: nixbuild/nix-quick-install-action@v29
with:
nix_conf: |
experimental-features = nix-command flakes
substituters = https://cache.nixos.org https://nix-community.cachix.org
trusted-public-keys = cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY= nix-community.cachix.org-1:mB9FSh9qf2dCimDSUo8Zy7bkq5CX+/rkCWyvRCYg3Fs=
# Caches /nix/store across runs, keyed on the flake inputs. GC's the
# store down to 1 GB before saving so the cache stays compact.
- name: Cache /nix/store
uses: nix-community/cache-nix-action@v7
with:
primary-key: nix-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock') }}
restore-prefixes-first-match: nix-${{ runner.os }}-
gc-max-store-size-linux: 1073741824
# Caches Clojure dependency artifacts (Maven jars, git deps, deps.clj
# cache). Re-keyed whenever deps.edn changes.
- name: Cache Clojure dependencies
uses: actions/cache@v5
with:
path: |
~/.m2/repository
~/.gitlibs
~/.deps.clj
.cpcache
key: ${{ runner.os }}-cljdeps-${{ hashFiles('deps.edn') }}
restore-keys: |
${{ runner.os }}-cljdeps-
# Realises the dev shell once. On cold cache, this is where the
# /nix/store gets populated from cache.nixos.org; on a warm cache,
# the previous step has already restored everything and this just
# validates that the flake itself still resolves cleanly.
- name: Build dev shell
run: nix develop --command bash -c "echo 'dev shell ready'"
- name: Lint (clj-kondo)
run: nix develop --command clj-kondo --lint src test
- name: Format (cljfmt)
run: nix develop --command cljfmt check
- name: Run tests
run: nix develop --command clojure -M:test