-
Notifications
You must be signed in to change notification settings - Fork 13
100 lines (89 loc) · 2.35 KB
/
ci.yml
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
98
99
100
name: CI
on:
push:
tags:
- '*'
paths:
- 'garminworkouts/**'
- 'tests/**'
- 'requirements.txt'
pull_request_target:
paths:
- 'garminworkouts/**'
- 'tests/**'
workflow_dispatch:
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: flake8 garminworkouts tests
build:
runs-on: ubuntu-latest
needs: [lint]
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
PYTHON_VERSION: ${{ matrix.python-version }}
GARMIN_USERNAME: ${{ secrets.GARMIN_USERNAME }}
GARMIN_PASSWORD: ${{ secrets.GARMIN_PASSWORD }}
vV02: ${{ secrets.vV02 }}
fmin: ${{ secrets.fmin }}
fmax: ${{ secrets.fmax }}
flt: ${{ secrets.flt }}
rFTP: ${{ secrets.rFTP }}
cFTP: ${{ secrets.cFTP }}
BOT_TOKEN: ${{ secrets.BOT_TOKEN }}
permissions:
actions: read
contents: read
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
python-version: ${{ matrix.python-version }}
- run: pytest --cov --junitxml=junit.xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.1.2
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON_VERSION
flags: unittests
verbose: true
- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
env_vars: PYTHON_VERSION
flags: unittests
verbose: true
result:
if: ${{ always() }}
runs-on: ubuntu-latest
needs: [build]
steps:
- run: |
result="${{ needs.build.result }}"
if [[ $result == "success" || $result == "skipped" ]]; then
exit 0
else
exit 1
fi
tag:
needs: [result]
if: ${{ needs.build.result }} == 'success'
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "0"
- name: Increment and tag with CalVer
uses: mani-sh-reddy/calver-increment@v1.2.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
YEAR_FORMAT: "YY"