-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
113 lines (99 loc) · 3.45 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
image:
name: meridiancfi/aisdb-manylinux:latest
entrypoint: [""]
workflow:
rules:
- if: $CI_COMMIT_TAG
when: never
- when: always
stages:
- artifacts
- python-test
- publish
wasm-assets:
stage: artifacts
#rules:
# - if: $CI_COMMIT_TAG
# when: always
image:
name: node:latest
before_script:
- apt update -y && apt-get install clang -y
- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | bash -s -- -y --profile=minimal --target=wasm32-unknown-unknown
- npm install -g wasm-pack
script:
- cd client_webassembly
- source ~/.cargo/env && wasm-pack build --target=web --release --out-dir=$CI_PROJECT_DIR/aisdb_web/map/pkg
- cd ../aisdb_web
- npm install
- cd map
- export VITE_DISABLE_SSL_DB=1
- export VITE_DISABLE_STREAM=1
- export VITE_AISDBHOST=localhost
- export VITE_AISDBPORT=9924
- npx vite build --outDir=$CI_PROJECT_DIR/aisdb_web/dist_map
- export VITE_BINGMAPTILES=1
- export VITE_TILESERVER=aisdb.meridian.cs.dal.ca
- npx vite build --outDir=$CI_PROJECT_DIR/aisdb_web/dist_map_bingmaps
# artifacts can be downloaded here:
# https://git-dev.cs.dal.ca/api/v4/projects/132/jobs/artifacts/<branch_name>/download?job=wasm-assets
artifacts:
when: always
paths:
- aisdb_web/map/pkg
- aisdb_web/dist_map
- aisdb_web/dist_map_bingmaps
python-test:
dependencies:
- wasm-assets
#needs:
# - job: wasm-assets
# artifacts: true
stage: python-test
variables:
#VIRTUAL_ENV: "/home/ais_env/env"
AISDBDATADIR: "data_dir"
AISDBTESTDIR: "testdata"
VIRTUAL_ENV: "/env_aisdb"
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: "sparse"
#before_script:
# - export PATH="/env_aisdb/bin/:$PATH"
script:
- mkdir -p data_dir testdata
#- python -c 'import os; os.makedirs("data_dir", exist_ok=True); os.makedirs("testdata", exist_ok=True)'
#- cargo test --color=always --release --lib --manifest-path=./aisdb_lib/Cargo.toml
- maturin develop --release --extras=test --strip
- /env_aisdb/bin/python -m pytest aisdb/tests/ --durations=5 -k 'not ShoreDist and not PortDist and not bathy and not raster and not marinetraffic and not postgres and not network_graph'
#- python -I -u -m pytest --durations=10 -k 'not ShoreDist and not PortDist and not bathy and not raster and not marinetraffic and not postgres and not network_graph' --doctest-modules --pyargs aisdb
- /env_aisdb/bin/python docker/coverage_ci.py
#coverage: '/TOTAL.*\s+(\d+\%)/'
#artifacts:
# paths:
# - /aisdb_src/target/wheels/*
# expire_in: 4 weeks
coverage: '/COVERAGE:.*\s+(\d+\%)/'
tag:
stage: publish
only:
refs:
- master
changes:
- "pyproject.toml"
- ".gitlab-ci.yml"
before_script:
- curl --location --output /usr/local/bin/release-cli "https://release-cli-downloads.s3.amazonaws.com/latest/release-cli-linux-amd64"
- chmod +x /usr/local/bin/release-cli
script:
- echo 'tagging release...'
release:
tag_name: $(cat pyproject.toml | grep version | grep -Eo --color=no "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")
description: $(cat pyproject.toml | grep version | grep -Eo --color=no "[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+")
#rules:
# - if: $CI_COMMIT_TAG
# when: always
variables:
ACCESS_TOKEN: $ACCESS_TOKEN
CI_SERVER_URL: $CI_SERVER_URL
CI_PROJECT_PATH: $CI_PROJECT_PATH
GITLAB_USER_NAME: $GITLAB_USER_NAME
GITLAB_USER_EMAIL: $GITLAB_USER_EMAIL