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 5668014
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 39 deletions.
46 changes: 15 additions & 31 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,35 @@ 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
- uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}

- 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: |
pip install poetry
poetry install --only=main,test --extras replaygain
- if: ${{ ! (matrix.python-version == env.PYTHON_VERSION && matrix.platform == 'ubuntu-latest') }}
name: Test without coverage
run: poetry run project 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

- 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
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
run: BrandonLWhite/pipx-install-action@v0.1.1
- 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/pipx-install-action@v0.1.1
- 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/pipx-install-action@v0.1.1
- 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 = "*"
poetry = "*"

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

0 comments on commit 5668014

Please sign in to comment.