Repository navigation
72 lines (59 loc) · 2.21 KB
/
Copy pathpython-app.yml
File metadata and controls
72 lines (59 loc) · 2.21 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "main", "development"]
pull_request:
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up uv (Python 3.12)
uses: astral-sh/setup-uv@v6.6.0
with:
python-version: "3.12"
activate-environment: true
enable-cache: true
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
- name: Set timezone
run: sudo timedatectl set-timezone Europe/Vienna
- name: Run pre-commit with prek
run: uv run --dev prek run -a
- name: Test with pytest
run: uv run pytest -s --run-ignored
- name: Commit and Push Changes
env:
PR_BRANCH: ${{ github.event.pull_request.head.ref }}
run: |
git add .
if git diff --cached --quiet; then
echo "No tracked files changed"
exit 0
fi
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Automated documentation update"
git push origin "HEAD:$PR_BRANCH"
# integration tests for DetectMateService
- name: Checkout DetectMateService
uses: actions/checkout@v4
with:
repository: ait-detectmate/DetectMateService
path: DetectMateService
- name: Prepare DetectMateService (using local DetectMateLibrary)
working-directory: DetectMateService
run: |
# remove the git-based dependency so we don't override the local lib
sed -i '/detectmatelibrary @ git+/d' pyproject.toml
- name: Prepare packages
working-directory: DetectMateService
run: uv pip install .
#- name: Run DetectMateService library integration tests
# working-directory: DetectMateService
# run: uv run --dev pytest tests/library_integration -s