-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy path.gitlab-ci.yml
58 lines (53 loc) · 1.1 KB
/
.gitlab-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
variables:
CARGO_HOME: $CI_PROJECT_DIR/cache
stages:
- prepare
- build
build-container:
image: docker:19.03.11
stage: prepare
services:
- docker:19.03.11-dind
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- docker pull $CI_REGISTRY_IMAGE:build || true
- docker build -t $CI_REGISTRY_IMAGE:build -f build/Dockerfile .
- docker push $CI_REGISTRY_IMAGE:build
test-library:
image: $CI_REGISTRY_IMAGE:build
stage: build
script:
- cargo clippy
cache:
key: test
paths:
- ./cache
build-linux:
image: $CI_REGISTRY_IMAGE:build
stage: build
script:
- cargo build --release
cache:
key: linux
paths:
- ./cache
- ./target
artifacts:
paths:
- ./target/release/jrsonnet
expire_in: 30 days
build-wasm:
image: $CI_REGISTRY_IMAGE:build
stage: build
script:
- cargo build --target=wasm32-wasi --release
cache:
key: wasm
paths:
- ./cache
- ./target
artifacts:
paths:
- ./target/wasm32-wasi/release/jsonnet.wasm
expire_in: 30 days