Skip to content

Commit

Permalink
fix(build): use and cache venv for API job
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Jan 23, 2023
1 parent a8bc371 commit 46e0fe2
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ stages:
cache:
key:
files:
- yarn.lock
- gui/yarn.lock
paths:
- gui/node_modules/
policy: pull-push
Expand Down Expand Up @@ -53,17 +53,26 @@ stages:
extends:
- .build-base
image: docker.io/python:3.10
cache:
key:
files:
- api/requirements.txt
paths:
- api/onnx_env/
policy: pull-push

.build-curl:
extends:
- .build-python
cache: {}

build-api-coverage:
extends:
- .build-python
stage: build
script:
- cd api
- ${CI_PROJECT_DIR}/common/scripts/make-venv.sh
- make ci

build-gui-bundle:
Expand Down
10 changes: 10 additions & 0 deletions common/scripts/make-venv.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 46e0fe2

Please sign in to comment.