-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Zaharia Constantin
committed
Apr 20, 2022
1 parent
d4350c5
commit 4816a26
Showing
129 changed files
with
12,613 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[flake8] | ||
ignore = W503 | ||
max-line-length = 99 | ||
exclude = .git, .github, .eggs, __pycache__, build, dist, notebooks, .ipynb_checkpoints, logs | ||
per-file-ignores = __init__.py:F401 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags-ignore: | ||
- '**' | ||
|
||
name: merge-to-main | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
|
||
- name: Run checks | ||
uses: ./.github/workflows/run-checks | ||
|
||
- name: Documentation Test | ||
run: | | ||
source .venv/bin/activate | ||
make docs-test | ||
tox: | ||
runs-on: ubuntu-latest | ||
needs: quality | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Test with tox | ||
run: | | ||
source .venv/bin/activate | ||
poetry add tox-gh-actions | ||
tox |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
|
||
name: on-pull-request | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
|
||
- name: Run checks | ||
uses: ./.github/workflows/run-checks | ||
|
||
- name: Documentation Test | ||
run: | | ||
source .venv/bin/activate | ||
make docs-test | ||
tox: | ||
runs-on: ubuntu-latest | ||
needs: quality | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Test with tox | ||
run: | | ||
source .venv/bin/activate | ||
poetry add tox-gh-actions | ||
tox |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
on: | ||
release: | ||
types: [published] | ||
branches: [main] | ||
|
||
name: release-main | ||
|
||
jobs: | ||
quality: | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
|
||
- name: Run checks | ||
uses: ./.github/workflows/run-checks | ||
|
||
- name: Documentation Test | ||
run: | | ||
source .venv/bin/activate | ||
make docs-test | ||
tox: | ||
runs-on: ubuntu-latest | ||
needs: quality | ||
strategy: | ||
matrix: | ||
python-version: ['3.10'] | ||
steps: | ||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Test with tox | ||
run: | | ||
source .venv/bin/activate | ||
poetry add tox-gh-actions | ||
tox | ||
publish: | ||
runs-on: ubuntu-latest | ||
needs: tox | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
|
||
- name: Set output | ||
id: vars | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Build and publish | ||
run: | | ||
source .venv/bin/activate | ||
poetry version $RELEASE_VERSION | ||
make build-and-publish | ||
env: | ||
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
|
||
documentation: | ||
runs-on: ubuntu-latest | ||
needs: publish | ||
steps: | ||
|
||
- name: Check out | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up the environment | ||
uses: ./.github/workflows/setup-poetry-env | ||
|
||
- name: Generate documentation | ||
run: | | ||
source .venv/bin/activate | ||
mkdocs gh-deploy --force |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
name: 'run-checks' | ||
description: 'Composite action to run checks for code formatting and to run the unittests.' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
|
||
- name: Formatting check | ||
run: | | ||
source .venv/bin/activate | ||
make lint | ||
shell: bash | ||
|
||
- name: Test with pytest | ||
run: | | ||
source .venv/bin/activate | ||
make test | ||
shell: bash |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
name: "setup-poetry-env" | ||
description: "Composite action to setup the Python and poetry environment." | ||
inputs: | ||
python-version: | ||
required: false | ||
description: "The python version to use" | ||
default: 3.10.4 | ||
runs: | ||
using: "composite" | ||
steps: | ||
#---------------------------------------------- | ||
# from: https://github.com/snok/install-poetry | ||
# check-out repo and set-up python | ||
#---------------------------------------------- | ||
- name: Check out repository | ||
uses: actions/checkout@v2 | ||
- name: Set up python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
#---------------------------------------------- | ||
# ----- install & configure poetry ----- | ||
#---------------------------------------------- | ||
- name: Install Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
#---------------------------------------------- | ||
# load cached venv if cache exists | ||
#---------------------------------------------- | ||
- 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: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: poetry install --no-interaction --no-root | ||
shell: bash | ||
#---------------------------------------------- | ||
# install your root project, if required | ||
#---------------------------------------------- | ||
- name: Install library | ||
run: poetry install --no-interaction | ||
shell: bash | ||
- name: Activate environment | ||
run: source .venv/bin/activate | ||
shell: bash |
Oops, something went wrong.