From 20736021022c11ea68842235585290d7d7300914 Mon Sep 17 00:00:00 2001 From: felinae98 <731499577@qq.com> Date: Thu, 17 Jun 2021 15:30:35 +0800 Subject: [PATCH] use cache when build --- .circleci/config.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fcd2c12..79bb71f 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ orbs: # so you dont have to copy and paste it everywhere. # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python python: circleci/python@1.2 - poetry: frameio/poetry@0.21.0 + # poetry: frameio/poetry@0.21.0 swissknife: roopakv/swissknife@0.59.0 workflows: @@ -32,9 +32,21 @@ jobs: steps: - checkout # - run: sed -e '41,45d' -i pyproject.toml - - poetry/install - - poetry/shell: - args: pytest --junitxml=test-results/junit.xml + - restore_cache: + keys: + - venv-cache-{{ checksum "poetry.lock" }} + - run: + name: Poetry install + command: | + poetry config settings.virtualenvs.in-project true + poetry install -v + - save_cache: + paths: + - .venv + key: venv-cache-{{ checksum "poetry.locl" }} + - run: + name: pytest + command: poetry run pytest --junitxml=test-results/junit.xml - store_test_results: path: test-results build-publish: @@ -47,5 +59,7 @@ jobs: path: dist - swissknife/publish_github_release: tag: ${CIRCLE_TAG} - - run: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD + - run: + command: poetry publish -u $PYPI_USERNAME -p $PYPI_PASSWORD + name: publish to pypi