-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.omni.yaml
56 lines (52 loc) · 1.46 KB
/
.omni.yaml
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
45
46
47
48
49
50
51
52
53
54
55
56
up:
- python:
pip:
- ./tests/requirements-tools.txt
- ./tests/requirements.txt
- ./tests/end-to-end/requirements.txt
- github-releases:
pypa/hatch: latest
commands:
test:
desc: Run all tests
run: |
omni test lint
omni test unit
subcommands:
lint:
desc: Run lint
run: flake8 apps/ tests/
unit:
desc: Run unit and integration tests
run: pytest --cache-clear tests/unit/ tests/integration/ "$@"
e2e:
desc: Run end-to-end tests
run: pytest --cache-clear tests/end-to-end/
build:
desc: Build the package
run: |
# Empty the build directory
rm -rf dist/
# Get the latest git tag
git_version=$(git describe --tags --dirty --always)
# Replace the first dash by a plus
version=$(echo ${git_version} | sed 's/-/+/')
# Write the version to the build version file
echo "__version__ = \"${version}\"" > build_version.py
# Build the package
hatch build
# Clean up
rm build_version.py
publish:
desc: Publish the package
run: |
# Get the latest git tag
git_version=$(git describe --tags --dirty --always)
clean_version=$(git describe --tags --abbrev=0)
# Check if the version values are the same
if [ "${git_version}" != "${clean_version}" ]; then
echo "The current version is not clean."
exit 1
fi
omni build
hatch publish