use cache when build

This commit is contained in:
felinae98 2021-06-17 15:30:35 +08:00
parent b3e305cbbb
commit 2073602102
No known key found for this signature in database
GPG Key ID: 00C8B010587FF610

View File

@ -6,7 +6,7 @@ orbs:
# so you dont have to copy and paste it everywhere. # so you dont have to copy and paste it everywhere.
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python # See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/python
python: circleci/python@1.2 python: circleci/python@1.2
poetry: frameio/poetry@0.21.0 # poetry: frameio/poetry@0.21.0
swissknife: roopakv/swissknife@0.59.0 swissknife: roopakv/swissknife@0.59.0
workflows: workflows:
@ -32,9 +32,21 @@ jobs:
steps: steps:
- checkout - checkout
# - run: sed -e '41,45d' -i pyproject.toml # - run: sed -e '41,45d' -i pyproject.toml
- poetry/install - restore_cache:
- poetry/shell: keys:
args: pytest --junitxml=test-results/junit.xml - 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: - store_test_results:
path: test-results path: test-results
build-publish: build-publish:
@ -47,5 +59,7 @@ jobs:
path: dist path: dist
- swissknife/publish_github_release: - swissknife/publish_github_release:
tag: ${CIRCLE_TAG} 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