Use ruff in CI #7
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: Main | |
on: push | |
env: | |
LC_ALL: C.UTF-8 | |
LANG: C.UTF-8 | |
jobs: | |
lint: | |
name: Code Quality | |
runs-on: ubuntu-latest | |
container: | |
image: colibris/tox:latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@master | |
- name: Install ruff | |
run: pip install ruff | |
- name: Run ruff | |
run: ruff colibris | |
test: | |
name: Test | |
needs: lint | |
runs-on: ubuntu-latest | |
container: | |
image: colibris/tox:latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@master | |
- name: Run tox | |
run: tox --workdir=/tmp/tox --recreate | |
release: | |
name: Release | |
if: startsWith(github.ref, 'refs/tags/version-') | |
needs: | |
- test | |
runs-on: ubuntu-latest | |
container: | |
image: colibris/tox:latest | |
steps: | |
- name: Source code checkout | |
uses: actions/checkout@master | |
- name: Extract version from tag | |
id: tagName | |
uses: little-core-labs/get-git-tag@v3.0.2 | |
with: | |
tagRegex: "version-(.*)" | |
- name: Update source version | |
run: sed -i "s/0.0.0+unknown/${GIT_TAG_NAME}/" colibris/__init__.py | |
- name: Python package setup | |
run: python setup.py sdist | |
- name: Publish to PyPI | |
uses: pypa/gh-action-pypi-publish@master | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} |