Skip to content

Commit

Permalink
Add tests workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
amsehili committed Dec 2, 2024
1 parent 8e94515 commit 7c33c07
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

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

jobs:
test:
strategy:
matrix:
python-version: ["3.4", "3.5", "3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
continue-on-error: ${{ matrix.python-version == '3.4' || matrix.python-version == '3.5' || matrix.python-version == '3.6' }}

- name: Fallback to Docker for Python 3.4-3.6
if: failure() && (matrix.python-version == '3.4' || matrix.python-version == '3.5' || matrix.python-version == '3.6')
run: |
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
python:${{ matrix.python-version }} \
bash -c "pip install pytest mutagen eyed3 && pytest -s -p no:warnings tests"
- name: Set up PYTHONPATH
if: success() || !(matrix.python-version == '3.4' || matrix.python-version == '3.5' || matrix.python-version == '3.6')
run: echo "PYTHONPATH=$PYTHONPATH:${{ github.workspace }}" >> $GITHUB_ENV

- name: Install dependencies
if: success()
run: |
sudo apt-get update --fix-missing
pip install pytest mutagen eyed3
- name: Run tests
if: success()
run: pytest -s -p no:warnings tests

0 comments on commit 7c33c07

Please sign in to comment.