-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
115 lines (103 loc) · 2.83 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
image: julia:1.10.4
stages:
- preparation
- test
- coverage
variables:
JULIA_DEPOT_PATH: "$CI_PROJECT_DIR/.julia"
JULIA_NUM_THREADS: 4
.build_cached:
cache:
key: "mare-build"
paths:
- .julia/compiled
- .julia/packages
- .julia/environments
policy: pull
prepare:
extends: .build_cached
stage: preparation
script:
- julia --check-bounds=yes -e'using Pkg; Pkg.activate("."); Pkg.update(); Pkg.resolve(); Pkg.instantiate(); Pkg.build()'
cache:
policy: pull-push
cache:
key: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG"
paths:
- .julia/compiled
- .julia/packages
- .julia/environments
before_script:
- echo "Using Julia version:"
- julia --version
#build:
# stage: build
# script:
# - echo "Adding and precompiling packages..."
# - julia --check-bounds=yes -e'using Pkg; Pkg.activate("."); Pkg.update(); Pkg.resolve(); Pkg.instantiate(); Pkg.build()'
# - ls $JULIA_DEPOT_PATH
# artifacts:
# paths:
# - .julia/compiled
# expire_in: 1 day
# cache:
# key: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG"
# paths:
# - .julia/compiled
# - .julia/packages
# - .julia/environments
test:
extends: .build_cached
stage: test
script:
- echo "Running tests..."
- julia -e 'using Pkg; Pkg.activate("."); Pkg.test("TaijaInteractive"; coverage=true, allow_reresolve=false)'
#Pkg.add("Coverage"); Pkg.add("Coverage");
#using Coverage;
#coverage = process_folder();
#coverage = append!(coverage, process_folder("app"));
#covered_lines, total_lines = get_summary(coverage);
#println("(", covered_lines, "%) covered");
#println("(", total_lines, "%) total");
#println("(", covered_lines/total_lines*100, "%) covered");
##clean_folder(".");
#Pkg.rm("Coverage");
#if (covered_lines/total_lines*100 < 40) exit(1) end'
artifacts:
paths:
- "**/*.cov"
#dependencies:
# - build
#cache:
# key: "$CI_PROJECT_NAME-$CI_COMMIT_REF_SLUG"
# paths:
# - .julia/compiled
# - .julia/packages
# - .julia/environments
#untracked: true
coverage:
stage: coverage
extends: .build_cached
script:
- echo "Running coverage..."
- julia -e 'using Pkg;
Pkg.instantiate();
Pkg.add("Coverage");
using Coverage;
coverage = process_folder();
coverage = append!(coverage, process_folder("app"));
covered_lines, total_lines = get_summary(coverage);
println("(", covered_lines, "%) covered");
println("(", total_lines, "%) total");
println("(", covered_lines/total_lines*100, "%) covered");
clean_folder(".");
Pkg.rm("Coverage");
if (covered_lines/total_lines*100 < 70) exit(1) end'
dependencies:
- test
#cache:
# key: "mare-build"
# paths:
# - .julia/compiled
# - .julia/packages
# - .julia/environments