Skip to content

Commit

Permalink
Fix test action
Browse files Browse the repository at this point in the history
Re-add conditional upload
Add poetry cache
  • Loading branch information
MarcelRosier committed Oct 9, 2024
1 parent 9646652 commit ade513c
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,31 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest] #, windows-latest, macos-latest]
python-version: ["3.10"] #, "3.11", "3.12"]
os: [ubuntu-latest, windows-latest, macos-latest]
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 }}
cache: "pip" # caching pip dependencies
cache: "poetry"

- name: Configure poetry
run: |
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry config virtualenvs.in-project true
- name: Cache the virtualenv
uses: actions/cache@v4
with:
path: ./.venv
key: ${{ matrix.os }}-${{matrix.python-version}}-venv-${{ hashFiles('**/poetry.lock') }}
- name: Install dependencies
run: |
python -m poetry install
- name: Test with pytest
- name: Test with pytest and create coverage report
run: |
python -m poetry run coverage run --source=panoptica -m pytest
python -m poetry run coverage xml
- name: Upload results to Codecov
- name: Upload coverage results to Codecov (Only on merge to main)
# Only upload to Codecov after a merge to the main branch
# if: github.ref == 'refs/heads/main' && github.event_name == 'push'
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit ade513c

Please sign in to comment.