-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
77 lines (72 loc) · 1.65 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
default:
interruptible: true
# Prevent duplicate pipelines
# https://docs.gitlab.com/ee/ci/yaml/workflow.html#switch-between-branch-pipelines-and-merge-request-pipelines
workflow:
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS
when: never
- if: $CI_COMMIT_BRANCH
.script:
script:
- |
julia --project=@. -e "
using Pkg
Pkg.build()
Pkg.test(coverage=${COVERAGE-false})"
.rules:
rules:
- if: $CI_COMMIT_BRANCH =~ /doc/
when: never
- when: always
test:
parallel:
matrix:
- IMAGE:
- julia:1.6
- julia:1.7
- julia:1.8
- julia:1.9
image: $IMAGE
variables:
COVERAGE: "true"
extends:
- .script
- .rules
artifacts:
when: always
name: artifact-$IMAGE
paths:
- "**/*.cov"
coverage:
image: julia:1.6
needs:
- test
extends:
- .rules
coverage: /Test coverage (\d+\.\d+%)/
script:
- |
julia --project=@. -e '
using Pkg
Pkg.add("LocalCoverage")
using LocalCoverage
c = generate_coverage(; run_test=false)
# Print overview
using Printf
@printf "Test coverage %.2f%%\n" c.coverage_percentage
# Generate detailed report for GitLab
using LocalCoverage: COVDIR, LCOVINFO
cobertura = joinpath(COVDIR, "cobertura.xml")
lcov = joinpath(COVDIR, LCOVINFO)
write_lcov_to_xml(cobertura, lcov)
'
artifacts:
paths:
- coverage/lcov.info
- coverage/cobertura.xml
reports:
coverage_report:
coverage_format: cobertura
path: coverage/cobertura.xml