-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.gitlab-ci.yml
106 lines (92 loc) · 3.19 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
#FinancialMonteCarlo.jl
variables:
JULIA_DEPOT_PATH: "$CI_PROJECT_DIR/.julia/"
stages:
- build
- test
- coverage
- benchmark
- deploy
before_script:
# Install build dependencies
- apt-get update && apt-get -y install cmake
- apt-get update && apt-get -y install gcc
- apt-get update && apt-get -y install g++
- apt-get update && apt-get -y install bzip2
- apt-get update && apt-get -y install git
# Below is the template to run your tests in Julia
.test_template: &build_definition
script:
- /usr/local/julia/bin/julia --project=@. -e 'using InteractiveUtils; versioninfo(); import Pkg; Pkg.build(); using FinancialMonteCarlo'
.test_template: &test_definition
script:
- /usr/local/julia/bin/julia --project=@. -e 'using InteractiveUtils; versioninfo(); import Pkg; Pkg.build(); using FinancialMonteCarlo'
- /usr/local/julia/bin/julia --project=@. -e 'import Pkg; Pkg.test(; coverage = true)'
artifacts:
when: on_success
paths:
- .julia/
- src/*.cov
- src/*/*.cov
- src/*/*/*.cov
- src/*/*/*/*.cov
expire_in: '1 hour'
.test_template: &cov_definition
script:
- export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/
- /usr/local/julia/bin/julia --project=@. -e 'using Pkg; Pkg.add("Coverage"); import Pkg; Pkg.build(); using FinancialMonteCarlo;
using Coverage; cl, tl = get_summary(process_folder());
println("(", cl/tl*100, "%) covered");
using Pkg; cd(Pkg.dir("FinancialMonteCarlo")); Codecov.submit_local(Codecov.process_folder())'
artifacts:
when: on_success
paths:
- .julia/
expire_in: '1 hour'
.test_template: &bench_definition
script:
- julia --project=benchmark -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
- julia --project=benchmark -e 'using Pkg; Pkg.instantiate(); include("benchmark/benchmarks.jl");'
# Name a test and select an appropriate image.
build:1.8:
stage: build
image: julia:1.8
<<: *build_definition
test:1.8:
stage: test
image: julia:1.8
<<: *test_definition
benchmark:1.8:
stage: benchmark
image: julia:1.8
<<: *bench_definition
coverage:1.8:
stage: coverage
image: julia:1.8
<<: *cov_definition
pages:
stage: deploy
image: julia:1.9
script:
- julia --project=docs -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- julia --project=docs --color=yes docs/make.jl
- mv docs/build public
artifacts:
paths:
- public
only:
- master
# REMARK: Do not forget to enable the coverage feature for your project, if you
# are using code coverage reporting above. This can be done by
#
# - Navigating to the `CI/CD Pipelines` settings of your project,
# - Copying and pasting the default `Simplecov` regex example provided, i.e.,
# `\(\d+.\d+\%\) covered` in the `test coverage parsing` textfield.
#
# WARNING: This template is using the `julialang/julia` images from [Docker
# Hub][3]. One can use custom Julia images and/or the official ones found
# in the same place. However, care must be taken to correctly locate the binary
# file (`/opt/julia/bin/julia` above), which is usually given on the image's
# description page.
#
# [3]: http://hub.docker.com/