-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (46 loc) · 1.47 KB
/
python-package-conda.yml
File metadata and controls
57 lines (46 loc) · 1.47 KB
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
57
name: CI
on: [ push ]
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
pip install pytest
pip install deepsource # Install DeepSource CLI
- name: Run tests
run: |
pytest --junitxml=pytest-results.xml
- name: Report test coverage to DeepSource
uses: deepsourcelabs/test-coverage-action@master
with:
key: python
coverage-file: pytest-results.xml
dsn: ${{ secrets.DEEPSOURCE_DSN }}
check-version:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 2 # Fetch at least the last two commits
- name: Check version bump
run: |
if git rev-parse HEAD~1 >/dev/null 2>&1; then
if git show HEAD:setup.py | grep "version=" | grep -q "$(git show HEAD~1:setup.py | grep "version=")"; then
echo "Error: Version in setup.py has not been bumped!"
exit 1
else
echo "Version bump detected in setup.py."
fi
else
echo "No previous commit detected; skipping version bump check."
fi