feat(build): add basic python CI
This commit is contained in:
parent
e9004793ab
commit
8d3ca31fef
|
@ -7,27 +7,6 @@ stages:
|
||||||
- platform:k8s
|
- platform:k8s
|
||||||
- runner:shared
|
- runner:shared
|
||||||
|
|
||||||
.build-node:
|
|
||||||
extends:
|
|
||||||
- .build-base
|
|
||||||
image: docker.io/node:18
|
|
||||||
artifacts:
|
|
||||||
expire_in: 1 day
|
|
||||||
paths:
|
|
||||||
- gui/out/
|
|
||||||
reports:
|
|
||||||
coverage_report:
|
|
||||||
coverage_format: cobertura
|
|
||||||
path: gui/out/coverage/cobertura-coverage.xml
|
|
||||||
junit: gui/out/test-results.xml
|
|
||||||
cache:
|
|
||||||
key:
|
|
||||||
files:
|
|
||||||
- yarn.lock
|
|
||||||
paths:
|
|
||||||
- gui/node_modules/
|
|
||||||
policy: pull-push
|
|
||||||
|
|
||||||
.build-dind:
|
.build-dind:
|
||||||
extends:
|
extends:
|
||||||
- .build-base
|
- .build-base
|
||||||
|
@ -49,7 +28,33 @@ stages:
|
||||||
DOCKER_TLS_VERIFY: 1
|
DOCKER_TLS_VERIFY: 1
|
||||||
VERSION_TAG: "${CI_COMMIT_REF_SLUG}"
|
VERSION_TAG: "${CI_COMMIT_REF_SLUG}"
|
||||||
|
|
||||||
build-gui-js:
|
.build-node:
|
||||||
|
extends:
|
||||||
|
- .build-base
|
||||||
|
image: docker.io/node:18
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 day
|
||||||
|
paths:
|
||||||
|
- gui/out/
|
||||||
|
reports:
|
||||||
|
coverage_report:
|
||||||
|
coverage_format: cobertura
|
||||||
|
path: gui/out/coverage/cobertura-coverage.xml
|
||||||
|
junit: gui/out/test-results.xml
|
||||||
|
cache:
|
||||||
|
key:
|
||||||
|
files:
|
||||||
|
- yarn.lock
|
||||||
|
paths:
|
||||||
|
- gui/node_modules/
|
||||||
|
policy: pull-push
|
||||||
|
|
||||||
|
.build-python:
|
||||||
|
extends:
|
||||||
|
- .build-base
|
||||||
|
image: docker.io/python:3.10
|
||||||
|
|
||||||
|
build-gui-bundle:
|
||||||
extends:
|
extends:
|
||||||
- .build-node
|
- .build-node
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -57,12 +62,20 @@ build-gui-js:
|
||||||
- cd gui
|
- cd gui
|
||||||
- make ci
|
- make ci
|
||||||
|
|
||||||
|
build-api-coverage:
|
||||||
|
extends:
|
||||||
|
- .build-python
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- cd api
|
||||||
|
- make ci
|
||||||
|
|
||||||
.package-gui-oci:
|
.package-gui-oci:
|
||||||
extends:
|
extends:
|
||||||
- .build-dind
|
- .build-dind
|
||||||
stage: package
|
stage: package
|
||||||
needs:
|
needs:
|
||||||
- build-gui-js
|
- build-gui-bundle
|
||||||
script:
|
script:
|
||||||
- cd gui
|
- cd gui
|
||||||
- ${CI_PROJECT_DIR}/common/scripts/image-build.sh --push
|
- ${CI_PROJECT_DIR}/common/scripts/image-build.sh --push
|
||||||
|
@ -87,7 +100,7 @@ package-gui-npm:
|
||||||
- .build-node
|
- .build-node
|
||||||
stage: package
|
stage: package
|
||||||
needs:
|
needs:
|
||||||
- build-gui-js
|
- build-gui-bundle
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
script:
|
script:
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
.PHONY: ci pip test package-dist package-upload
|
||||||
|
|
||||||
|
onnx_env: ## create virtual env
|
||||||
|
python -v venv onnx_env
|
||||||
|
|
||||||
|
ci: pip test
|
||||||
|
|
||||||
|
pip:
|
||||||
|
if [ -z $${VIRTUAL_ENV+x} ]; then echo "Are you sure you want to install dependencies outside of a virtual environment?"; sleep 30; fi
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
test:
|
||||||
|
python -m coverage run -m unittest discover -s tests/
|
||||||
|
python -m coverage html
|
||||||
|
python -m coverage xml
|
||||||
|
|
||||||
|
package-dist:
|
||||||
|
python ./setup.py sdist
|
||||||
|
|
||||||
|
package-upload:
|
||||||
|
twine upload dist/*
|
Loading…
Reference in New Issue