Repository navigation
70 lines (68 loc) · 2.64 KB
/
Copy pathpython-package.yml
File metadata and controls
70 lines (68 loc) · 2.64 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
name: Python Package
on:
push:
branches:
- main
paths:
- 'python/**'
- '.github/workflows/python-package.yml'
pull_request:
paths:
- 'python/**'
- '.github/workflows/python-package.yml'
schedule:
- cron: '0 0 */7 * *'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e "./python[tests]"
pip install flake8 mypy build pytest-cov pip-audit
- name: Lint
run: cd python && python -m flake8 FlightRadarAPI tests
- name: Type check
run: cd python && python -m mypy FlightRadarAPI --ignore-missing-imports
- name: Offline tests (PR gate)
run: cd python && pytest -m "not integration" --cov=FlightRadarAPI --cov-report=term --cov-report=xml -v
- name: Integration tests (live FR24)
uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0
with:
timeout_minutes: 10
max_attempts: 3
command: cd python && pytest -m integration -vv -s
continue-on-error: ${{ github.event_name == 'push' }}
- name: Dependency audit (shipped dependencies)
# Enforced, and scoped to what users actually install: a vulnerable dev
# tool must not block every PR, but a vulnerable runtime dep must.
if: matrix.python-version == '3.13'
run: |
python -m venv /tmp/shipenv
/tmp/shipenv/bin/pip install --quiet --upgrade pip
/tmp/shipenv/bin/pip install --quiet ./python
/tmp/shipenv/bin/pip freeze | grep -v "^FlightRadarAPI" > /tmp/shipped.txt
cat /tmp/shipped.txt
pip-audit -r /tmp/shipped.txt
- name: Dependency audit (dev toolchain, informational)
if: matrix.python-version == '3.13'
continue-on-error: true
run: |
pip freeze | grep -v "^FlightRadarAPI" > /tmp/devenv.txt
pip-audit -r /tmp/devenv.txt
- name: Build and verify install
run: |
python -m build ./python
pip install python/dist/*.whl --force-reinstall
python -c "from FlightRadarAPI import FlightRadar24API; api = FlightRadar24API(); print('Install OK')"