upgrade dependencies #321
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: Validate Pull Request | |
on: | |
# Triggers the workflow on push or pull request events but only for the main branch | |
pull_request: | |
branches: [ main ] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
# Do sanity check once on Ubuntu with Python 3.9 and test on the rest | |
sanityCheck: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Validate poetry configuration | |
run: poetry check | |
- name: Validate styling | |
run: | | |
pip install pylint | |
poetry run pylint **/*.py | |
# Test on all supported Python versions and OSes | |
test_x86: | |
needs: sanityCheck | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
python-version: ['3.8', '3.9', '3.10'] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup Python | |
uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Poetry | |
uses: snok/[email protected] | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: Run tests | |
run: poetry run pytest | |
# Test on ARM using docker containers | |
test_arm_linux: | |
needs: sanityCheck | |
runs-on: self-hosted-arm-linux | |
container: | |
image: ${{ matrix.docker-image }} | |
strategy: | |
fail-fast: false | |
matrix: | |
docker-image: ['python:3.8-bullseye', 'python:3.9-bullseye', 'python:3.10-bullseye'] | |
steps: | |
# See: https://github.com/actions/runner/issues/2193 | |
- name: Pre clean up the home dir with poetry cache | |
run: | | |
rm -rf /github/home/.cache/ | |
rm -rf /github/home/.local/ | |
- uses: actions/checkout@v2 | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | POETRY_VERSION=1.1.6 python3 - | |
echo "/github/home/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
poetry install --no-interaction | |
- name: Run tests | |
run: poetry run pytest | |
- name: Post clean up the home dir with poetry cache | |
run: | | |
rm -rf /github/home/.cache/ | |
rm -rf /github/home/.local/ |