Skip to content

Drop Python 3.7, fix genre shenanigans, parse 'with' and 'w/' #362

Drop Python 3.7, fix genre shenanigans, parse 'with' and 'w/'

Drop Python 3.7, fix genre shenanigans, parse 'with' and 'w/' #362

Workflow file for this run

---
name: Code quality
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
beets: ["1.4.9", "1.5.0", "1.6.0"]
steps:
- uses: actions/checkout@v3
with:
# Disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0
- name: Generate requirements.txt
run: ./generate_requirements
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
cache: pip
- name: Install dependencies
run: |
pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
pip install beets==${{ matrix.beets }}
pip install coveralls
pip install -e .
- name: Pytest
run: pytest -k 'not need_connection' --ignore-glob='*test_lib*'
- name: Upload coverage data to coveralls.io
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: python${{ matrix.python }}_beets${{ matrix.beets }}
COVERALLS_PARALLEL: true
- name: Lint flake8
run: flake8 . --output-file flake.log --exit-zero
- name: Lint mypy
run: mypy > mypy.log || true
- name: Lint pylint
run: pylint --output pylint.log --exit-zero $(git ls-files '*.py')
- name: Set project version
run: echo PROJECT_VERSION="$(git describe --tags | sed 's/-[^-]*$//')" >> $GITHUB_ENV
- name: SonarCloud Scan
if: ${{ matrix.beets == '1.5.0' && matrix.python == '3.8' }}
uses: SonarSource/sonarcloud-github-action@master
with:
args: >
-Dsonar.branch.name=${{ github.ref_name }}
-Dsonar.organization=snejus
-Dsonar.projectKey=snejus_beetcamp
-Dsonar.projectVersion=${{ env.PROJECT_VERSION }}
-Dsonar.coverage.exclusions=tests/*
-Dsonar.exclusions=tests/*
-Dsonar.python.coverage.reportPaths=.reports/coverage.xml
-Dsonar.python.flake8.reportPaths=flake.log
-Dsonar.python.pylint.reportPaths=pylint.log
-Dsonar.python.mypy.reportPaths=mypy.log
-Dsonar.python.version=3.8
-Dsonar.python.xunit.reportPath=.reports/test-report.xml
-Dsonar.sources=beetsplug/bandcamp
-Dsonar.tests=tests
-Dsonar.test.inclusions=tests/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
coveralls:
if: ${{ always() }}
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}