chore(cicd): use ruff as formatter #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: [push, pull_request] | |
concurrency: | |
group: cicd-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
name: Test on Linux64 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install poetry | |
run: pipx install poetry==1.3.2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "poetry" | |
- name: Install system deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install \ | |
libgirepository1.0-dev \ | |
libcairo2-dev \ | |
python3-gi \ | |
gobject-introspection \ | |
libgtk-4-dev | |
- name: Poetry install | |
run: poetry install | |
- name: Ruff | |
run: poetry run ruff check . | |
- name: Ruff format | |
run: poetry run ruff format --check --diff . | |
- name: Mypy | |
run: poetry run mypy | |
- name: Pytest | |
run: poetry run pytest | |
- name: Test AppImage build | |
run: poetry run make clean-build | |
publish: | |
name: Build & Publish | |
needs: test | |
if: startsWith(github.ref, 'refs/tags/v') | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install poetry | |
run: pipx install poetry==1.3.2 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.10" | |
cache: "poetry" | |
- name: Install system deps | |
run: | | |
sudo apt-get update | |
sudo apt-get install \ | |
libgirepository1.0-dev \ | |
libcairo2-dev \ | |
python3-gi \ | |
gobject-introspection \ | |
libgtk-4-dev | |
- name: Poetry install | |
run: poetry install | |
# Prepare Release | |
- name: Build AppImage | |
run: poetry run make clean-build | |
- name: Draft release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: | | |
*.AppImage | |
body: | |
See [CHANGELOG](https://github.com/dynobo/keyhint/blob/main/CHANGELOG.md) | |
for details. | |
draft: true | |
prerelease: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
# Publish to PyPi | |
- name: Build and publish to PyPi | |
run: | | |
poetry publish \ | |
--build \ | |
--username __token__ \ | |
--password ${{ secrets.PYPI_KEYHINT_TOKEN }} |