1
0
Fork 0

fix(build): use and cache venv for API job

This commit is contained in:
Sean Sube 2023-01-22 21:02:00 -06:00
parent a8bc371478
commit 46e0fe2cf7
2 changed files with 20 additions and 1 deletions

View File

@ -23,7 +23,7 @@ stages:
cache: cache:
key: key:
files: files:
- yarn.lock - gui/yarn.lock
paths: paths:
- gui/node_modules/ - gui/node_modules/
policy: pull-push policy: pull-push
@ -53,10 +53,18 @@ stages:
extends: extends:
- .build-base - .build-base
image: docker.io/python:3.10 image: docker.io/python:3.10
cache:
key:
files:
- api/requirements.txt
paths:
- api/onnx_env/
policy: pull-push
.build-curl: .build-curl:
extends: extends:
- .build-python - .build-python
cache: {}
build-api-coverage: build-api-coverage:
extends: extends:
@ -64,6 +72,7 @@ build-api-coverage:
stage: build stage: build
script: script:
- cd api - cd api
- ${CI_PROJECT_DIR}/common/scripts/make-venv.sh
- make ci - make ci
build-gui-bundle: build-gui-bundle:

10
common/scripts/make-venv.sh Executable file
View File

@ -0,0 +1,10 @@
#! /bin/sh
if [ -d onnx_env ];
then
echo "Activating existing venv..."
source onnx_env/bin/activate
else
echo "Creating new venv..."
python3 -m venv onnx_env
fi