-
-
Notifications
You must be signed in to change notification settings - Fork 3
88 lines (83 loc) · 2.6 KB
/
ci.yml
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
77
78
79
80
81
82
83
84
85
86
87
88
name: CI
on:
push:
branches:
- main
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
pull_request:
branches:
- main
permissions:
contents: read
jobs:
test:
name: Test and lint
runs-on: ubuntu-22.04
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: lein deps
- name: Run code formatting checks
run: lein cljfmt check
- name: Run linters
run: lein clj-kondo
- name: Run tests
run: lein cloverage --codecov
- name: Update code coverage report
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: |
curl https://keybase.io/codecovsecurity/pgp_keys.asc | gpg --no-default-keyring --keyring trustedkeys.gpg --import
curl -Os https://uploader.codecov.io/latest/linux/codecov
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM
curl -Os https://uploader.codecov.io/latest/linux/codecov.SHA256SUM.sig
gpgv codecov.SHA256SUM.sig codecov.SHA256SUM
shasum -a 256 -c codecov.SHA256SUM
chmod +x codecov
./codecov -t ${CODECOV_TOKEN} -f target/coverage/codecov.json
license:
name: License compliance
runs-on: ubuntu-22.04
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get deps licenses
run: lein licenses :csv > licenses.csv
- name: Check licenses
id: license_check_report
uses: pilosus/action-pip-license-checker@v2
with:
external: 'licenses.csv'
external-format: 'csv'
external-options: '{:skip-header false :package-column-index 0 :license-column-index 2}'
formatter: '%-65s %-65s %-20s'
totals: true
headers: true
fail: 'StrongCopyleft,NetworkCopyleft,Other,Error'
verbose: 1
- name: Print report
if: ${{ always() }}
run: echo "${{ steps.license_check_report.outputs.report }}"
publish:
name: Publish on Clojars
runs-on: ubuntu-22.04
needs: [test, license]
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout the code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies
run: lein deps
- name: Publish artifact
env:
CLOJARS_USERNAME: ${{ secrets.CLOJARS_USERNAME }}
CLOJARS_PASSWORD: ${{ secrets.CLOJARS_PASSWORD }}
run: lein deploy releases