-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
90 lines (82 loc) · 2.21 KB
/
Copy path.gitlab-ci.yml
File metadata and controls
90 lines (82 loc) · 2.21 KB
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
stages:
- test
- test-cpp
- build-python-wheel
- upload-python-wheel
- build-cpp
- test-python
variables:
EXTENSION_DIR: "DynamicBufferCpp/"
EXTENSION_TEST_DIR: "DynamicBufferCpp/Google_tests/"
DOCKER_CLI_EXPERIMENTAL: "enabled"
include:
- template: Security/Dependency-Scanning.gitlab-ci.yml
gemnasium-python-dependency_scanning:
image:
name: registry.gitlab.com/gitlab-org/security-products/analyzers/gemnasium-python:2-python-3.9
checkstyle:
stage: test-python
image: python:3.9.12-bullseye
before_script:
- pip install dynamic-buffer --extra-index-url https://gitlab-ci-token:$CI_JOB_TOKEN@gitlab.forge.hefr.ch/api/v4/projects/$CI_PROJECT_ID/packages/pypi/simple
- pip install ".[flake8]"
script:
- flake8 --output-file checkstyle-report.txt
after_script:
- flake8_junit checkstyle-report.txt checkstyle-report.xml
artifacts:
when: always
paths:
- checkstyle-report.xml
reports:
junit:
- checkstyle-report.xml
tests-cpp:
stage: test-cpp
image: ubuntu:20.04
before_script:
- cd $EXTENSION_TEST_DIR
script:
- export DEBIAN_FRONTEND=noninteractive
- apt update
- apt install -y git build-essential cmake libgtest-dev g++
- mkdir build
- cd build
- cmake ..
- make -j
- ./Google_Tests_run
build-python-wheel:
stage: build-python-wheel
image: python:3.9.12-bullseye
before_script:
- pip install build
- cd $EXTENSION_DIR
script:
- python -m build
artifacts:
paths:
- $EXTENSION_DIR/dist/*
upload-python-wheel:
stage: upload-python-wheel
image: python:3.9.12-bullseye
dependencies:
- build-python-wheel
before_script:
- pip install twine
script:
- twine upload $EXTENSION_DIR/dist/* --repository gitlab --config-file .pypirc
tests-python:
stage: test-python
image: python:3.9.12-bullseye
before_script:
- pip install dynamic-buffer --extra-index-url https://gitlab-ci-token:$CI_JOB_TOKEN@gitlab.forge.hefr.ch/api/v4/projects/$CI_PROJECT_ID/packages/pypi/simple
- pip install ".[test]"
script:
- pytest tests -v --junitxml=tests-report.xml
artifacts:
when: always
paths:
- tests-report.xml
reports:
junit:
- tests-report.xml