Skip to content

Planning

Planning #253

Workflow file for this run

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"