-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (46 loc) · 1.61 KB
/
Copy pathtesting_python_app.yml
File metadata and controls
57 lines (46 loc) · 1.61 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
permissions:
contents: read
pull-requests: write
on:
push:
pull_request:
jobs:
tests:
name: "Python ${{ matrix.python-version }}"
runs-on: ${{ matrix.os }}
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
strategy:
matrix:
os: [ubuntu-22.04, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: "actions/checkout@v3"
with:
fetch-depth: 0
# Setup env
- uses: "actions/setup-python@v3"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies on ${{ matrix.os }} for Python ${{ matrix.python-version }}"
run: |
python --version
python -m pip install --upgrade pip
pip install --upgrade pip wheel setuptools flit
flit install --deps develop
- name: "Lint on ${{ matrix.os }} for Python ${{ matrix.python-version }}"
run: |
ruff check src tests
- name: "Generate coverage report on ${{ matrix.os }} for Python ${{ matrix.python-version }}"
run: |
PYTHONPATH=src pytest --cov=src/agtools --cov-report=xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: Vini2/agtools
- name: Upload coverage reports to Codacy
if: ${{ matrix.os == 'ubuntu-22.04' && matrix.python-version == '3.12' && env.CODACY_PROJECT_TOKEN != '' }}
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report -r coverage.xml