Skip to content

Merge pull request #1 from slafebre/patch-1 #35

Merge pull request #1 from slafebre/patch-1

Merge pull request #1 from slafebre/patch-1 #35

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Lint & tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10"]
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 dependencies
run: |
python -m pip install --upgrade pip
# Let's test with latest versions defined in setup.py and leave locked requirements.txt to deployments.
python -m pip install '.[dev]'
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Run unit test with Pytest
run: |
DEGIROASYNC_INTEGRATION=0 pytest --color yes
docs-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
# Let's test with latest versions defined in setup.py and leave locked requirements.txt to deployments.
python -m pip install '.[dev]'
- name: Build docs
run: cd docs/ && make html
- uses: actions/upload-artifact@v2
with:
name: docs
path: docs/build/html
docs-deploy:
runs-on: ubuntu-latest
needs: [build, docs-build]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: docs
path: docs/build/html
- name: Disable jekyll builds
run: touch docs/build/html/.nojekyll
- name: Install dependencies
run: |
npm install -g --silent gh-pages@3.0.0
- name: Deploy with gh-pages
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
npx gh-pages --dotfiles -d docs/build/html -u "github-actions-bot <support+actions@github.com>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}