Skip to content

Commit

Permalink
Update workflows again
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Jun 7, 2024
1 parent cbce606 commit 7c85c48
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 42 deletions.
50 changes: 18 additions & 32 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,37 @@ jobs:
platform: [ubuntu-latest, windows-latest]
python-version: ["3.8", "3.9"]
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4
- name: Install Python tools
uses: BrandonLWhite/[email protected]
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
python-version: ${{ matrix.python-version }}
cache: poetry

- name: Install base dependencies
run: |
pip install poetry
poetry install
- name: Install linux dependencies
if: matrix.platform != 'windows-latest'
- name: Install PyGobject dependencies
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install ffmpeg gobject-introspection libgirepository1.0-dev
poetry install --extras replaygain
- name: Test the code
- name: Install Python dependencies
run: poetry install --only=main,test

- if: ${{ ! (matrix.python-version == env.PYTHON_VERSION && matrix.platform == 'ubuntu-latest') }}
name: Test without coverage
run: poe test --no-cov

- if: matrix.python-version == env.PYTHON_VERSION && matrix.platform == 'ubuntu-latest'
name: Test with coverage
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: pytest
run: poetry run project test
run: poe test

- name: Upload code coverage
if: matrix.python-version == ${{ env.PYTHON_VERSION }} && matrix.platform == 'ubuntu-latest'
- if: matrix.python-version == env.PYTHON_VERSION && matrix.platform == 'ubuntu-latest'
name: Upload code coverage
continue-on-error: true
run: poetry run codecov

test-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: snok/install-poetry@v1

- name: Install docs dependencies
run: poetry install --with=docs

- uses: sphinx-doc/github-problem-matcher@master

- name: Build docs
run: poetry run project docs
4 changes: 2 additions & 2 deletions .github/workflows/integration_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
- name: Test
env:
INTEGRATION_TEST: 1
run: poetry run project test
run: poe test

- name: Check external links in docs
run: poetry run project check-docs-links
run: poe check-docs-links

- name: Notify on failure
if: ${{ failure() }}
Expand Down
37 changes: 29 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,58 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python tools
uses: BrandonLWhite/[email protected]
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: snok/install-poetry@v1
cache: poetry

- name: Install dependencies
run: poetry install --with=lint
run: poetry install --only=main,lint

- name: Lint code
uses: liskin/gh-problem-matcher-wrap@v2
with:
linters: flake8, isort
run: |
poetry run isort --check --diff beets beetsplug test
poetry run flake8 .
run: poe lint

typing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python tools
uses: BrandonLWhite/[email protected]
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: snok/install-poetry@v1
cache: poetry

- name: Install dependencies
run: poetry install --with=typing
run: poetry install --only=main,typing

- name: Type check code
uses: liskin/gh-problem-matcher-wrap@v2
continue-on-error: true
with:
linters: mypy
run: poetry run mypy --show-column-numbers --no-error-summary
run: poe check-types --show-column-numbers --no-error-summary

docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Python tools
uses: BrandonLWhite/[email protected]
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: poetry

- name: Install dependencies
run: poetry install --only=main,docs

- uses: sphinx-doc/github-problem-matcher@master
name: Build docs
with:
run: poe docs
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ release = "extra.release:cli"
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

[tool.pipx-install]
poethepoet = ">=0.26"
poetry = ">=1.8"

[tool.poe.tasks.bump]
help = "Bump project version and update relevant files"
cmd = "release bump $version"
Expand Down

0 comments on commit 7c85c48

Please sign in to comment.