Skip to content

Commit

Permalink
Modernize (#69)
Browse files Browse the repository at this point in the history
* modernize github workflows

* remove codeql (as it will be deprecated)

* poetry relock

* change for and add py3.10

* added Python 3.10 support

* add Python 3.10 to classifiers

* add macos tests
clean up linting

* poetry relock

* re-add tox

* add tox-gh-actions

* update deps

* remove install-options

* python to 3.7

Co-authored-by: Jason Carvalho <jason@20c.com>
  • Loading branch information
vegu and jason20c authored May 26, 2022
1 parent fc17865 commit 0b2aa89
Show file tree
Hide file tree
Showing 6 changed files with 501 additions and 491 deletions.
37 changes: 5 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,15 @@ name: ci
on:
push:
branches:
- master
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.x
- name: Load cached Poetry installation
uses: actions/cache@v2
with:
path: ~/.local
key: poetry-0
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true

- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
- name: Ensure cache is healthy
if: steps.cache.outputs.cache-hit == 'true'
shell: bash
run: timeout 10s poetry run pip --version || rm -rf .venv
# install dependencies if cache does not exist
- name: Check cache and install dependencies
run: poetry install --no-interaction
- name: Run tests
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
- name: deploy mkdocs gh-pages site
run: |
source .venv/bin/activate
mkdocs gh-deploy --force
poetry run mkdocs gh-deploy --force
44 changes: 11 additions & 33 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,33 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: true
virtualenvs-in-project: true
installer-parallel: true

# virtualenvs-path: ~/.venv
- name: Load cached venv
id: cached-poetry-dependencies
uses: actions/cache@v2
with:
path: .venv
key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }}
# install dependencies if cache does not exist
- name: Check cache and install dependencies
run: poetry install --no-interaction --no-root
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true'
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
# poetry run pre-commit run --all-files
- name: Run linters
run: |
poetry run isort src/
poetry run black --check src/
poetry run pre-commit run --all-files
poetry run flake8 src/
test:
# XXX needs: linting
needs: linting
strategy:
fail-fast: false
matrix:
os: [ "ubuntu-latest", "macos-latest" ]
python-version: [ "3.7", "3.8", "3.9" ]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]
runs-on: ${{ matrix.os }}
steps:
- name: Check out repository
uses: actions/checkout@v2
- name: Set up python ${{ matrix.python-version }}
uses: actions/setup-python@v2
- name: Install virtualenv from poetry
uses: 20c/workflows/poetry@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install --upgrade pip
pip install tox tox-gh-actions
- name: Run tests
run: tox
run: |
poetry run tox
poetry run coverage report
# upload coverage stats
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
Unreleased:
added:
- add `SettingsManager.try_include()`
- Python 3.10 support (#64)
changed:
- documentation moved to github pages
deprecated: []
Expand Down
Loading

0 comments on commit 0b2aa89

Please sign in to comment.