Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 38 additions & 38 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,64 +2,64 @@ name: build

on:
push:
branches: [master]
branches: [master]
pull_request:
branches: [master]
branches: [master]

jobs:
test:
strategy:
fail-fast: true
matrix:
os: [ "ubuntu-latest" ]
python-version: [ "3.10", "3.11", "3.12" ]
runs-on: ${{ matrix.os }}
python-version: ["3.10", "3.11", "3.12"]

runs-on: ubuntu-latest

steps:
#----------------------------------------------
# check-out repo and set-up python
#----------------------------------------------
- name: Check out repository
uses: actions/checkout@v3
- name: Set up python ${{ matrix.python-version }}
id: setup-python
uses: actions/setup-python@v4
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
#----------------------------------------------
# ----- install & configure poetry -----
#----------------------------------------------

- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
#----------------------------------------------
# load cached venv if cache exists
#----------------------------------------------
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v3

# ---- SMALL CACHE (no .venv!) ----
- name: Load pip/poetry cache
uses: actions/cache@v4
with:
path: .venv
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
#----------------------------------------------
# install dependencies if cache does not exist
#----------------------------------------------
path: |
~/.cache/pip
~/.cache/pypoetry
key: poetry-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
poetry-${{ matrix.python-version }}-

- name: Install dependencies
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
#----------------------------------------------
# install your root project, if required
#----------------------------------------------
- name: Install library
run: poetry install --no-interaction
#----------------------------------------------
# add matrix specifics and run test suite
#----------------------------------------------

- name: Activate virtualenv
run: echo "VIRTUAL_ENV=$(poetry env info --path)" >> $GITHUB_ENV

# ---- Install test extras needed ONLY for CI ----
- name: Install pytest-xdist (optional, safe)
run: |
source $VIRTUAL_ENV/bin/activate
pip install pytest-xdist

- name: Run tests
run: |
source $VENV
pytest -v --cov-report xml:coverage.xml --cov=muvi --color=yes
source $VIRTUAL_ENV/bin/activate
pytest -v \
--cov=muvi \
--cov-report xml:coverage.xml \
--color=yes

- name: Upload coverage
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v3
Loading
Loading