-
Notifications
You must be signed in to change notification settings - Fork 1
140 lines (122 loc) · 3.93 KB
/
push_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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
---
name: "GitHub CI"
permissions:
contents: read
pull-requests: write
actions: read
issues: read
discussions: write
repository-projects: write
checks: write
on:
pull_request:
branches: [master]
jobs:
clj-kondo:
runs-on: ubuntu-latest
timeout-minutes: 5
container: cljkondo/clj-kondo:2024.03.13-alpine
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Run clj-kondo
run: >-
clj-kondo
--config .clj-kondo/config.edn
--config-dir .clj-kondo
--parallel
--lint src test
cljstyle:
runs-on: ubuntu-latest
timeout-minutes: 5
container: abogoyavlensky/cljstyle:0.15.0
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Check with cljstyle
run: cljstyle check --report
megalinter:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Mega-Linter
id: ml
uses: nvuillam/mega-linter/flavors/[email protected]
env:
# All available variables are described in documentation
# https://nvuillam.github.io/mega-linter/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} # Validates all source when push on master, else just the git diff with master. Override with true if you always want to lint all sources
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Upload Mega-Linter artifacts
- name: Archive production artifacts
if: ${{ success() }} || ${{ failure() }}
uses: actions/upload-artifact@v4
with:
name: Mega-Linter reports
path: |
report
mega-linter.log
build:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: zulu
java-version: 17
- name: Restore local Maven repository from cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generate proto files
run: lein protodeps generate
- name: Build uberjar
run: lein uberjar
test:
needs:
- build
- clj-kondo
- cljstyle
- megalinter
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Checkout
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: zulu
java-version: 17
- name: Restore local Maven repository from cache
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles( 'project.clj' ) }}
restore-keys: |
${{ runner.os }}-maven-
- name: Generate proto files
run: lein protodeps generate
- name: Unit tests
env:
IP_STACK_ACCESS_KEY: ${{ secrets.IP_STACK_ACCESS_KEY }}
run: lein cloverage --html --lcov --junit
- name: Publish Unit Test Results
uses: EnricoMi/[email protected]
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
files: "target/coverage/junit.xml"
- name: Coveralls
uses: coverallsapp/github-action@3dfc5567390f6fa9267c0ee9c251e4c8c3f18949 # v2.2.3
with:
path-to-lcov: "target/coverage/lcov.info"
github-token: ${{ secrets.GITHUB_TOKEN }}