Skip to content

Update python-release.yml #3

Update python-release.yml

Update python-release.yml #3

Workflow file for this run

name: Python test
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
os: [ "ubuntu-latest" ]
python-version: ['3.8', '3.9', '3.10', '3.11']
# python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Install library
run: poetry install --no-interaction
- name: Test with pytest
run: poetry run pytest --cov=flagship --cov-report=xml ./tests/
- name: Upload coverage
if: matrix.python-version == 3.8
uses: codecov/codecov-action@v3
with:
file: ./coverage.xml
fail_ci_if_error: false