mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-20 21:18:32 +02:00
Moved repeated commands into commands section for reuse in jobs
Circle apparently allows you to separate custom commands into their own key, and then reuse them at will in jobs.
This commit is contained in:
parent
d766c65d78
commit
07558cc824
1 changed files with 52 additions and 36 deletions
|
@ -5,19 +5,20 @@ executors:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python:3.7.9
|
- image: circleci/python:3.7.9
|
||||||
resource_class: small
|
resource_class: small
|
||||||
|
|
||||||
python38:
|
python38:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python:3.8.6
|
- image: circleci/python:3.8.6
|
||||||
resource_class: small
|
resource_class: small
|
||||||
|
|
||||||
python39:
|
python39:
|
||||||
docker:
|
docker:
|
||||||
- image: circleci/python:3.9.0
|
- image: circleci/python:3.9.0
|
||||||
resource_class: small
|
resource_class: small
|
||||||
|
|
||||||
aliases:
|
commands:
|
||||||
linux_test: &linux_test
|
get_poetry_deps:
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
|
||||||
- run:
|
- run:
|
||||||
name: Checking Python version
|
name: Checking Python version
|
||||||
command: python --version > /tmp/pythonversion
|
command: python --version > /tmp/pythonversion
|
||||||
|
@ -32,51 +33,28 @@ aliases:
|
||||||
key: 'deps-00-{{ checksum "poetry.lock" }}-{{ checksum "/tmp/pythonversion" }}'
|
key: 'deps-00-{{ checksum "poetry.lock" }}-{{ checksum "/tmp/pythonversion" }}'
|
||||||
paths:
|
paths:
|
||||||
- ~/project/.venv
|
- ~/project/.venv
|
||||||
- run: poetry install
|
|
||||||
|
pytest:
|
||||||
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: Tests - Pytest
|
name: Tests - Pytest
|
||||||
when: always
|
|
||||||
command: >
|
command: >
|
||||||
poetry run pytest
|
poetry run pytest
|
||||||
--junitxml=reports/pytest/results.xml
|
--junitxml=reports/pytest/results.xml
|
||||||
|
|
||||||
|
behave:
|
||||||
|
steps:
|
||||||
- run:
|
- run:
|
||||||
name: Tests - Behave
|
name: Tests - Behave
|
||||||
when: always
|
|
||||||
command: >
|
command: >
|
||||||
poetry run behave
|
poetry run behave
|
||||||
--no-skipped
|
--no-skipped
|
||||||
--format progress2
|
--format progress2
|
||||||
--junit
|
--junit
|
||||||
--junit-directory reports/behave
|
--junit-directory reports/behave
|
||||||
- store_test_results:
|
|
||||||
path: reports
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
linux_test_37:
|
|
||||||
executor: python37
|
|
||||||
<<: *linux_test
|
|
||||||
|
|
||||||
linux_test_38:
|
|
||||||
executor: python38
|
|
||||||
<<: *linux_test
|
|
||||||
|
|
||||||
linux_test_39:
|
|
||||||
executor: python39
|
|
||||||
<<: *linux_test
|
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
executor: python39
|
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
|
||||||
- run: python --version > /tmp/pythonversion
|
|
||||||
- restore_cache:
|
|
||||||
key: 'deps-00-{{ checksum "poetry.lock" }}-{{ checksum "/tmp/pythonversion" }}'
|
|
||||||
- run: poetry config --local virtualenvs.in-project true
|
|
||||||
- run: poetry install --no-root --remove-untracked
|
|
||||||
- save_cache:
|
|
||||||
key: 'deps-00-{{ checksum "poetry.lock" }}-{{ checksum "/tmp/pythonversion" }}'
|
|
||||||
paths:
|
|
||||||
- ~/project/.venv
|
|
||||||
- run:
|
- run:
|
||||||
name: Poetry Check
|
name: Poetry Check
|
||||||
command: |
|
command: |
|
||||||
|
@ -93,10 +71,48 @@ jobs:
|
||||||
poetry run pyflakes --version
|
poetry run pyflakes --version
|
||||||
poetry run pyflakes jrnl features tests
|
poetry run pyflakes jrnl features tests
|
||||||
|
|
||||||
|
aliases:
|
||||||
|
linux_test: &linux_test
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- get_poetry_deps
|
||||||
|
- run: poetry install
|
||||||
|
- pytest:
|
||||||
|
when: always
|
||||||
|
- behave:
|
||||||
|
when: always
|
||||||
|
- store_test_results:
|
||||||
|
path: reports
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
test_37_linux:
|
||||||
|
executor: python37
|
||||||
|
<<: *linux_test
|
||||||
|
|
||||||
|
test_38_linux:
|
||||||
|
executor: python38
|
||||||
|
<<: *linux_test
|
||||||
|
|
||||||
|
test_39_linux:
|
||||||
|
executor: python39
|
||||||
|
<<: *linux_test
|
||||||
|
|
||||||
|
linting:
|
||||||
|
executor: python39
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- get_poetry_deps
|
||||||
|
- lint
|
||||||
|
|
||||||
workflows:
|
workflows:
|
||||||
|
version: 2
|
||||||
main:
|
main:
|
||||||
jobs:
|
jobs:
|
||||||
- lint
|
- linting:
|
||||||
- linux_test_37
|
name: Linting and Formatting
|
||||||
- linux_test_38
|
- test_37_linux:
|
||||||
- linux_test_39
|
name: Python 3.7 - Linux
|
||||||
|
- test_38_linux:
|
||||||
|
name: Python 3.8 - Linux
|
||||||
|
- test_39_linux:
|
||||||
|
name: Python 3.9 - Linux
|
||||||
|
|
Loading…
Add table
Reference in a new issue