|
| 1 | +# Copyright 2019-present Sonatype Inc. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +version: 2.1 |
| 16 | + |
| 17 | +executors: |
| 18 | + python: |
| 19 | + docker: |
| 20 | + - image: circleci/python:3.7 |
| 21 | + |
| 22 | +jobs: |
| 23 | + publish: |
| 24 | + executor: python |
| 25 | + environment: |
| 26 | + PIPENV_VENV_IN_PROJECT: true |
| 27 | + steps: |
| 28 | + - add_ssh_keys: |
| 29 | + fingerprints: |
| 30 | + # TODO: change fingerprint |
| 31 | + - "4f:7d:6b:26:dc:44:de:b0:4d:f1:96:50:2a:b5:bd:b3" |
| 32 | + - checkout |
| 33 | + - run: |
| 34 | + name: Setup Python environment |
| 35 | + command: | |
| 36 | + # TODO: do stuff, like setup venv, poetry, pip etc |
| 37 | + - run: |
| 38 | + command: | |
| 39 | + # TODO: perform publish steps, maybe using python-semantic-release |
| 40 | +
|
| 41 | + build: |
| 42 | + executor: python |
| 43 | + environment: |
| 44 | + PIPENV_VENV_IN_PROJECT: true |
| 45 | + steps: |
| 46 | + - checkout |
| 47 | + - run: |
| 48 | + name: Setup Python environment |
| 49 | + command: | |
| 50 | + # TODO: do stuff, like setup .venv, poetry, pip etc. |
| 51 | + - run: |
| 52 | + name: Run tests |
| 53 | + command: | |
| 54 | + # TODO: maybe run pylint and run those tests |
| 55 | + - run: |
| 56 | + name: Run self scan |
| 57 | + command: | |
| 58 | + # TODO: audit with jake maybe? |
| 59 | + - store_test_results: # Upload test results for display in Test Summary: https://circleci.com/docs/2.0/collect-test-data/ |
| 60 | + path: test-results |
| 61 | + - store_artifacts: # Upload test summary for display in Artifacts: https://circleci.com/docs/2.0/artifacts/ |
| 62 | + path: test-results |
| 63 | + destination: tr1 |
| 64 | + |
| 65 | +workflows: |
| 66 | + version: 2 |
| 67 | + build_and_test_and_publish: |
| 68 | + jobs: |
| 69 | + - build |
| 70 | +# TODO: enable to publish after successful build |
| 71 | +# - publish: |
| 72 | +# filters: |
| 73 | +# branches: |
| 74 | +# only: main |
| 75 | +# context: pypi |
| 76 | +# requires: |
| 77 | +# - build |
| 78 | + |
| 79 | + build_nightly: |
| 80 | + triggers: |
| 81 | + - schedule: |
| 82 | + cron: "35 20 * * *" |
| 83 | + filters: |
| 84 | + branches: |
| 85 | + only: main |
| 86 | + jobs: |
| 87 | + - build |
0 commit comments