feat: added flake8 #4
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: Python package with Poetry and MkDocs Deploy | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
pull_request: | |
branches: | |
- main | |
- develop | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ["3.9", "3.10", "3.11"] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Cache Poetry dependencies | |
uses: actions/cache@v2 | |
with: | |
path: ~/.cache/pypoetry | |
key: ${{ runner.os }}-poetry-${{ hashFiles('**/pyproject.toml') }} | |
restore-keys: | | |
${{ runner.os }}-poetry- | |
- name: Install dependencies using Poetry | |
run: | | |
poetry install | |
- name: Lint with flake8 using Poetry | |
run: | | |
poetry run flake8 . | |
- name: Test with pytest using Poetry | |
run: | | |
poetry run python -m pytest | |
deploy: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Install MkDocs | |
run: pip install mkdocs | |
- name: Build MkDocs documentation | |
run: mkdocs build | |
- name: Deploy to GitHub Pages | |
run: | | |
git config user.name "GitHub Actions" | |
git config user.email "actions@github.com" | |
mkdocs gh-deploy --force | |
- name: Clean up | |
run: | | |
rm -rf site |