-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
121 lines (112 loc) · 3.48 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
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
variables:
DEBIAN_FRONTEND: noninteractive
COMPOSER_NO_INTERACTION: "1"
COURSIER_VERSION: 1.0.3
SCALA_VERSION: "2.12"
JAR_NAME: "swsg"
NODE_VERSION: "10"
stages:
- build
- examples
- test_examples
.scala-job: &scala
image: hseeberger/scala-sbt:8u171_2.12.6_1.1.6
before_script:
- mkdir -p ~/.sbt/0.13/plugins
- echo "addSbtPlugin(\"io.get-coursier\" % \"sbt-coursier\" % \"$COURSIER_VERSION\")" >> ~/.sbt/0.13/plugins/coursier.sbt
- mkdir -p ~/.sbt/1.0/plugins
- echo "addSbtPlugin(\"io.get-coursier\" % \"sbt-coursier\" % \"$COURSIER_VERSION\")" >> ~/.sbt/1.0/plugins/coursier.sbt
- java -version
- javac -version
build:
<<: *scala
stage: build
script:
- curl -sL https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
- apt-get update && apt-get install -y nodejs
- ./sbt test swsgJVM/assembly swsgJS/fastOptJS
- java -jar jvm/target/scala-$SCALA_VERSION/$JAR_NAME.jar --help
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHA"
paths:
#- project/project/
#- project/target/
#- js/target/
- js/target/scala-$SCALA_VERSION/$JAR_NAME-fastopt.js
- js/target/scala-$SCALA_VERSION/$JAR_NAME-fastopt.js.map
#- jvm/target/
- jvm/target/scala-$SCALA_VERSION/$JAR_NAME.jar
expire_in: 15 day
tags:
- docker
check_registration_example:
<<: *scala
stage: examples
dependencies:
- build
script:
- java -jar jvm/target/scala-$SCALA_VERSION/$JAR_NAME.jar check --model examples/registration/registration.model
tags:
- docker
gen_registration_example:
<<: *scala
stage: examples
script:
- java -jar jvm/target/scala-$SCALA_VERSION/$JAR_NAME.jar gen --model examples/registration/registration.model --implementation examples/registration/impl/ --backend laravel --output examples/registration/output/
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHA"
paths:
- examples/registration/output/
expire_in: 1 day
tags:
- docker
gen_petstore_example:
<<: *scala
stage: examples
script:
- java -jar jvm/target/scala-$SCALA_VERSION/$JAR_NAME.jar gen --model examples/petstore/petstore.json --implementation examples/petstore/impl/ --backend laravel --output examples/petstore/output/
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHA"
paths:
- examples/petstore/output/
expire_in: 1 day
tags:
- docker
gui:
stage: examples
image: debian
script:
- mv js/target/scala-$SCALA_VERSION/$JAR_NAME-fastopt.js gui/
- mv js/target/scala-$SCALA_VERSION/$JAR_NAME-fastopt.js.map gui/
- sed -i "s/..\/js\/target\/scala-$SCALA_VERSION\/$JAR_NAME-fastopt.js/$JAR_NAME-fastopt.js/" gui/*.html
artifacts:
name: "$CI_JOB_NAME-$CI_COMMIT_SHA"
paths:
- gui/
expire_in: 15 day
tags:
- docker
test_registration_example:
image: composer
stage: test_examples
dependencies:
- gen_registration_example
script:
- cd examples/registration/output/
- sed -i 's/App\\Providers\\RouteServiceProvider::class/App\\Providers\\GeneratedRouteServiceProvider::class/' config/app.php
- composer install --no-progress
- ./vendor/bin/phpunit
tags:
- docker
test_petstore_example:
image: composer
stage: test_examples
dependencies:
- gen_petstore_example
script:
- cd examples/petstore/output/
- sed -i 's/App\\Providers\\RouteServiceProvider::class/App\\Providers\\GeneratedRouteServiceProvider::class/' config/app.php
- composer install --no-progress
- ./vendor/bin/phpunit
tags:
- docker