-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci.sh
executable file
·44 lines (34 loc) · 837 Bytes
/
ci.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
# Initializing global variables and functions:
: "${CI:=0}"
pyclean () {
echo 'cleaning up...'
}
run_ci () {
echo '[ci started]'
set -x # we want to print commands during the CI process.
# Testing filesystem and permissions:
touch .perm && rm -f .perm
poetry install
poetry run pre-commit run --all-files
poetry run mypy
poetry check
poetry run pip check
poetry run pytest --cov=tests --cov=difflume
poetry run pytest --dead-fixtures
poetry build
poetry export --format=requirements.txt --output=dist/requirements.txt
# print shasum of the built packages
shasum dist/*
set +x
echo '[ci finished]'
}
# Remove any cache before the script:
pyclean
# Clean everything up:
trap pyclean EXIT INT TERM
# Run the CI process:
run_ci