Repository navigation
97 lines (77 loc) · 2.83 KB
/
Copy pathci.yml
File metadata and controls
97 lines (77 loc) · 2.83 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- uses: actions/checkout@v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- name: Install dependencies
run: uv sync --group dev
- name: Lint handwritten library
if: matrix.python-version == '3.12'
run: uv run --frozen ruff check fit_tool
- name: Type-check parser boundaries
if: matrix.python-version == '3.12'
run: >-
uv run --frozen mypy fit_tool/fit_file.py fit_tool/fit_file_stream.py fit_tool/exceptions.py
--follow-imports=skip --allow-untyped-defs --allow-incomplete-defs --no-strict-optional
- name: Build package
run: uv build
- name: Test with python ${{ matrix.python-version }}
run: uv run --frozen pytest
- name: Run tests with coverage
run: uv run pytest --cov=fit_tool --cov-report=xml --cov-report=term --junitxml=junit.xml
- name: Upload coverage to Codecov
if: matrix.python-version == '3.12'
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
fail_ci_if_error: false
- name: Upload test results to Codecov
if: ${{ !cancelled() && matrix.python-version == '3.12' }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./junit.xml
garmin-js-interop:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7.0.1
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
python-version: "3.12"
enable-cache: true
- name: Install dependencies
run: uv sync --group dev
- name: Read bundled Garmin Profile version
id: fit_version
run: echo "sdk_version=$(uv run --frozen python -c 'from fit_tool import SDK_VERSION; print(SDK_VERSION)')" >> "$GITHUB_OUTPUT"
- name: Check out matching Garmin JavaScript SDK
uses: actions/checkout@v7.0.1
with:
repository: garmin/fit-javascript-sdk
ref: ${{ steps.fit_version.outputs.sdk_version }}
path: .garmin-fit-javascript-sdk
persist-credentials: false
- name: Install Node.js
uses: actions/setup-node@v7
with:
node-version: "24"
- name: Run bidirectional Garmin SDK interoperability tests
env:
FIT_JS_SDK_PATH: ${{ github.workspace }}/.garmin-fit-javascript-sdk
run: uv run --frozen pytest fit_tool/tests/test_garmin_sdk_interop.py -q