forked from Convex-Dev/convex.cljc
-
Notifications
You must be signed in to change notification settings - Fork 0
232 lines (177 loc) · 5.19 KB
/
workflow.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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: workflow
on: push
##########
jobs:
# Lint Clojure
#
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Caching for Clojure dependencies
uses: actions/cache@v3
with:
key: clj-kondo-${{ hashFiles('bb.edn', 'deps.edn') }}
path: |
~/.deps.clj
~/.gitlibs
~/.m2/repository
restore-keys: clj-kondo-
- name: Prepare Clojure
uses: DeLaGuardo/setup-clojure@9.5
with:
bb: latest
cli: latest
clj-kondo: latest
- name: Prepare Clj-kondo
run: bb lint:prepare
- name: Run Clj-kondo
run: bb lint
# Tests modules
#
test:
strategy:
matrix:
java-version:
- 17
os:
- macos-12
- ubuntu-latest
# - windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}
- name: Caching for Clojure dependencies
uses: actions/cache@v3
with:
key: test-${{ hashFiles('bb.edn', 'deps.edn') }}
path: |
~/.deps.clj
~/.gitlibs
~/.m2/repository
restore-keys: test-
- name: Prepare Clojure
uses: DeLaGuardo/setup-clojure@9.5
with:
bb: latest
cli: latest
- name: Test `:module/break`
env:
MPROP_MAX_SIZE: 50
MPROP_NUM_TESTS: 50
run: bb test :module/break
- name: Test `:module/cvm`
run: bb test :module/cvm
- name: Test `:module/net`
run: bb test :module/net
# Builds the uberjar for the Convex Shell
#
build-shell-uberjar:
defaults:
run:
shell: bash
strategy:
matrix:
os:
# - macos-12
- ubuntu-latest
# - windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Caching for Clojure dependencies
uses: actions/cache@v3
with:
key: shell-uberjar-${{ hashFiles('bb.edn', 'deps.edn') }}
path: |
~/.deps.clj
~/.gitlibs
~/.m2/repository
restore-keys: shell-uberjar-
- name: Prepare Clojure
uses: DeLaGuardo/setup-clojure@9.5
with:
bb: latest
cli: latest
- name: Caching for Clojure dependencies
uses: actions/cache@v3
with:
key: build-shell-uberjar-${{ hashFiles('deps.edn', 'bb.edn') }}
path: |
~/.deps.clj
~/.gitlibs
~/.m2/repository
restore-keys: build-shell-uberjar-
- name: Build Convex Shell
run: bb build :module/shell
- name: Test Convex Shell
run: java -jar ./private/target/shell.uber.jar '(.dep.test (quote (test convex shell)) {:skip [:slow?]})'
- name: Upload uberjar
if: runner.os == 'Linux'
uses: actions/upload-artifact@v3
with:
if-no-files-found: error
name : shell.uber.jar
path : ./private/target/shell.uber.jar
# Builds native images for the Convex Shell
#
build-shell-native:
needs: build-shell-uberjar
strategy:
matrix:
os:
- macos-12
- ubuntu-latest
- windows-latest
platform:
- amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Prepare Clojure
uses: DeLaGuardo/setup-clojure@9.5
with:
bb: latest
- name: Prepare GraalVM
uses: graalvm/setup-graalvm@v1
with:
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}
java-version: 17
version: '22.2.0'
- name: Download Convex Shell uberjar
uses: actions/download-artifact@v3
with:
name: shell.uber.jar
path: ./private/target
- name: Build native Convex Shell
run: bb native:image :module/shell shell
- name: Test native Convex Shell
run: ./shell '(.dep.test (quote (test convex shell)) {:skip [:slow? :unix?]}))'
shell: bash
- name: Upload native executable
uses: actions/upload-artifact@v3
with:
name : shell-${{ runner.os }}-${{ matrix.platform }}
path : |
./shell
./shell.exe