Revamped API code and enhanced example code #17
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| "on": | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| branches: | |
| - main | |
| - master | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e .[testing,linting] | |
| - name: Lint with ruff | |
| run: | | |
| ruff check . | |
| - name: Format check with black | |
| run: | | |
| black --check . | |
| - name: Type check with mypy | |
| run: | | |
| mypy garminconnect --ignore-missing-imports | |
| - name: Test with pytest | |
| env: | |
| GARMINTOKENS: ${{ secrets.GARMINTOKENS }} | |
| run: | | |
| pytest tests/ -v --tb=short | |
| - name: Upload coverage reports | |
| if: matrix.python-version == '3.11' | |
| env: | |
| GARMINTOKENS: ${{ secrets.GARMINTOKENS }} | |
| run: | | |
| pip install coverage[toml] | |
| coverage run -m pytest -v --tb=short | |
| coverage xml | |
| continue-on-error: true | |
| - name: Upload coverage artifact | |
| if: matrix.python-version == '3.11' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| path: coverage.xml | |
| security: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install bandit[toml] safety | |
| - name: Security check with bandit | |
| run: | | |
| bandit -r garminconnect -f json -o bandit-report.json || true | |
| - name: Safety check | |
| run: | | |
| safety check --json --output safety-report.json || true | |
| continue-on-error: true |