Skip to content

Update README.md

Update README.md #277

Workflow file for this run

name: Build
on:
workflow_dispatch:
matrix:
python-version: 3.9
os: ubuntu-latest
push:
branches:
- '*'
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
strategy:
fail-fast: false
matrix:
python-version: [3.9]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up python
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Run poetry image
uses: abatilo/actions-poetry@v2.3.0
with:
poetry-version: 1.4.0
- name: Cache poetry virtualenv
uses: actions/cache@v3
id: cache
with:
path: ~/.virtualenvs
key: venv-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/poetry.lock') }}
- name: Set poetry config
run: |
poetry config virtualenvs.in-project false
poetry config virtualenvs.path ~/.virtualenvs
- name: Install dependencies
run: poetry install
if: steps.cache.outputs.cache-hit != 'true'
- name: Run tests
run: poetry run pytest --cov . --cov-report xml:.coverage-reports/coverage.xml
- name: Autoformat code
if: ${{ (matrix.os == 'ubuntu-latest') }}
run: |
poetry run isort .
poetry run black .
git config --global user.name '${{ github.actor }}'
git config --global user.email '${{ github.actor }}@users.noreply.github.com'
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git checkout $GITHUB_HEAD_REF
git commit -am "autoformat: isort & black" && git push || true
- name: SonarCloud Scan
if: ${{ (matrix.os == 'ubuntu-latest') }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}