-
Notifications
You must be signed in to change notification settings - Fork 11
191 lines (152 loc) · 4.45 KB
/
cicd.yaml
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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
name: CI / CD
on: [push]
jobs:
static-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install Clojure Tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.10.1.693
- name: Install Snyk
uses: snyk/actions/setup@master
- name: Generate pom.xml
shell: bash
run: clojure -Spom
- name: Run Snyk to check for vulnerabilities
run: snyk monitor
env:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
- name: Run FOSSA to scan licenses
uses: fossa-contrib/fossa-action@v1
with:
fossa-api-key: ${{ secrets.FOSSA_API_KEY }}
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Java 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Install Clojure Tools
uses: DeLaGuardo/[email protected]
with:
cli: 1.10.1.693
- name: Test Linux & OSX
if: ${{ matrix.os != 'windows-latest' }}
shell: bash
run: clojure -M:kaocha --plugin cloverage --codecov
- name: Test Windows
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
run: clojure -M:kaocha --plugin cloverage --codecov
- uses: codecov/codecov-action@v1
with:
files: target/coverage/codecov.json
flags: ${{ matrix.os }}
- name: Build JAR
if: ${{ matrix.os == 'ubuntu-latest' }}
run: package/package.sh
- name: Upload JAR Artifacts
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: actions/upload-artifact@v2-preview
with:
name: cq-jvm
path: target/cq*
native:
if: startsWith(github.ref, 'refs/tags/')
needs: build
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
gu-binary: [gu, gu.cmd]
exclude:
- os: ubuntu-latest
gu-binary: gu.cmd
- os: macos-latest
gu-binary: gu.cmd
- os: windows-latest
gu-binary: gu
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: cq-jvm
path: target
- name: Setup GraalVM
uses: DeLaGuardo/[email protected]
with:
graalvm: '21.0.0.2'
java: java11
arch: amd64
- name: Install native-image Component
run: |
${{ matrix.gu-binary }} install native-image
- name: Install MSVC Toolset (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: ilammy/msvc-dev-cmd@v1
- name: Build Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
shell: bash
run: |
./package/build-native.sh
mv target/cq target/cq-native-linux
- name: Build OSX
if: ${{ matrix.os == 'macos-latest' }}
shell: bash
run: |
./package/build-native.sh
mv target/cq target/cq-native-macos
- name: Build Windows
if: ${{ matrix.os == 'windows-latest' }}
shell: powershell
run: |
package\build-native.bat
mv target\cq.exe target\cq-native-windows.exe
- name: Upload Native Image Artifact
uses: actions/upload-artifact@v2-preview
with:
name: cq-all
path: target/cq*
release:
if: startsWith(github.ref, 'refs/tags/')
needs: native
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v2
with:
name: cq-all
path: target
- name: Rename cq-jvm to -SLOW
shell: bash
run: |
mv target/cq-jvm target/cq-jvm-slow
mv target/cq-jvm.exe target/cq-jvm-slow.exe
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
./target/cq-jvm*
./target/cq-native*
./target/cq.jar
LICENSE
README.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}