-
Notifications
You must be signed in to change notification settings - Fork 1
/
.plz.yaml
22 lines (21 loc) · 1008 Bytes
/
.plz.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
- id: publish
cmd:
# Confirm we're on the master branch
- bash -c "git rev-parse --abbrev-ref HEAD | xargs -I {} bash -c '[ {} == master ] || (echo Please checkout master branch for publishing && exit 1)'"
# Confirm we're up to date with remote origin
- bash -c "git fetch origin; git diff --quiet -- ...remotes/origin/HEAD || (echo Please fetch latest commits from origin && exit 1)"
# Confirm there aren not any local, uncommitted changes
- bash -c "git diff-index --quiet HEAD -- || (echo Please revert or PR local changes to origin && exit 1)"
# Confirm all tests are passing
- bash -c "plz test || (echo Please fix the tests and try again && exit 1)"
# Create tag and push to remote origin
- bash -c "poetry version | awk '{print $2}' | xargs -I {} bash -c 'git tag -a {} -m {} && git push origin {}'"
- id: test
cmd:
- poetry run python -m pytest
- id: setup
cmd:
- poetry install
- poetry run pre-commit install
- id: lint
cmd: poetry run pre-commit run --all-files