Merge pull request #205 from MihaMi27/TCX-GPX-Refactoring #176
This file contains 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: sport-activities-features | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest] | |
python-version: ['3.11'] | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Get full Python version | |
id: full-python-version | |
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))") | |
- name: Install poetry | |
run: | | |
pipx install "poetry>=1.3.0,<1.4.0" | |
- name: Update path | |
if: ${{ matrix.os != 'windows-latest' }} | |
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Update Windows path | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: echo "$APPDATA\Python\Scripts" >> $GITHUB_PATH | |
- name: Configure poetry | |
run: poetry config virtualenvs.in-project true | |
- name: Set up cache | |
uses: actions/cache@v3 | |
id: cache | |
with: | |
path: .venv | |
key: venv-${{ runner.os }}-${{ steps.full-python-version.outputs.version }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Ensure cache is healthy | |
if: steps.cache.outputs.cache-hit == 'true' | |
run: timeout 10s poetry run pip --version || rm -rf .venv | |
- name: Install dependencies | |
run: poetry install | |
- name: Run tests | |
run: poetry run pytest -k 'not test_overpy_node_manipulation and not test_weather and not test_data_analysis' | |
- name: Windows tests | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pytest -k 'not test_overpy_node_manipulation and not test_weather and not test_data_analysis' |