This repository has been archived by the owner on Sep 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
84 lines (76 loc) · 2.13 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
# CONFIGURATION
default:
image: "registry.gitlab.com/tangram-vision/oss/ci-oss/public-ci:latest"
before_script:
- rustup update stable
stages:
- test
- doc
- build_artifacts
##### ########## ########## ########## ########## #####
# TEST STAGE
# - [PASS REQ] runs all unit tests in the build
# - [PASS REQ] runs a lint checker over every piece of code
test:
stage: test
script:
- rustc --version
- cargo --version
- cargo test --verbose
lint:
stage: test
script:
- rustc --version
- cargo --version
- cargo clippy --all-targets --all-features -- -D warnings
##### ########## ########## ########## ########## #####
# DOC STAGE
# - [PASS OPT] checks for documentation on all relevant pieces of code
# - [PASS REQ] creates documentation pages
doc-check:
stage: doc
script:
- cargo clippy --all-targets --all-features -- -A clippy::all -D clippy::missing_docs_in_private_items
allow_failure: true
readme-check:
stage: doc
variables:
# Catches and fails on non-zero status
FF_ENABLE_BASH_EXIT_CODE_CHECK: 1
script:
- readme_check.sh --no-badges --no-title --no-indent-headings
pages:
stage: doc
# Run this at the same time as test and lint jobs
# https://docs.gitlab.com/ee/ci/yaml/#needs
needs: []
script:
# Don't include --document-private-items because we only want to show
# crate-level docs from lib.rs for end-users.
- cargo doc --no-deps
- mkdir public
- cp -r target/doc/* public
- cp -r assets public/
- LOWERCASE_PROJECT_NAME=$(echo $CI_PROJECT_NAME | awk '{print tolower($0)}') && echo "<meta http-equiv=refresh content=0;url=$LOWERCASE_PROJECT_NAME>" > public/index.html
artifacts:
paths:
- public
only:
- main
##### ########## ########## ########## ########## #####
# ARTIFACTS STAGE
# - [PASS REQ] update our badges on the project page by
# creating new SVG artifacts in the ci/ folder.
build_badges:
stage: build_artifacts
script:
- rustc --version
- cargo --version
- tangram-badge-generator -d $CI_PROJECT_DIR
artifacts:
paths:
- ./ci/*.svg
when: always
expire_in: 4 weeks
only:
- main