mirror of
https://github.com/beetbox/beets.git
synced 2026-02-01 13:03:59 +01:00
Changed the logic so that it isn't testing repeatedly for the correct matrix version, and since we're using poetry instead of pipx, changed the action
54 lines
1.4 KiB
YAML
54 lines
1.4 KiB
YAML
name: Test
|
|
on:
|
|
pull_request:
|
|
push:
|
|
branches:
|
|
- master
|
|
env:
|
|
MIN_PYTHON_VERSION: 3.8
|
|
PY_COLORS: 1
|
|
IS_MAIN_PYTHON: ${{ matrix.python-version == env.MIN_PYTHON_VERSION && matrix.platform == 'ubuntu-latest' }}
|
|
|
|
jobs:
|
|
test:
|
|
name: Run tests
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
platform: [ubuntu-latest, windows-latest]
|
|
python-version: ["3.8", "3.9"]
|
|
runs-on: ${{ matrix.platform }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install Python
|
|
uses: actions/setup-python@v5
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
cache: 'poetry'
|
|
|
|
- name: Install PyGobject dependencies on Ubuntu
|
|
if: startsWith(matrix.platform, 'ubuntu-')
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install ffmpeg gobject-introspection libgirepository1.0-dev
|
|
|
|
|
|
- name: Install Python dependencies with Poetry
|
|
run: |
|
|
poetry install --no-root
|
|
if [ "${{ env.IS_MAIN_PYTHON }}" = "true" ]; then
|
|
poetry install --extras replaygain
|
|
fi
|
|
|
|
- name: Run tests
|
|
run: |
|
|
if [ "${{ env.IS_MAIN_PYTHON }}" = "true" ]; then
|
|
poe test
|
|
else
|
|
poe test --no-cov
|
|
fi
|
|
|
|
- name: Upload code coverage
|
|
if: env.IS_MAIN_PYTHON
|
|
continue-on-error: true
|
|
run: poetry run codecov
|