-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added github workflows for test, lint, docs, and publish
- Loading branch information
Michael Panchenko
committed
Mar 1, 2024
1 parent
5523ddb
commit 5fe7a71
Showing
7 changed files
with
154 additions
and
8 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
56 changes: 56 additions & 0 deletions
56
{{cookiecutter.project_name}}/.github/workflows/lint_and_docs.yaml
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,56 @@ | ||
name: PEP8, Types and Docs Check | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel previous run | ||
uses: styfle/[email protected] | ||
{% raw -%} | ||
with: | ||
access_token: ${{ github.token }} | ||
{%- endraw %} | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: {{cookiecutter.python_version}} | ||
# use poetry and cache installed packages, see https://github.com/marketplace/actions/python-poetry-action | ||
{% raw -%} | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v2 | ||
- name: Setup a local virtual environment (if no poetry.toml file) | ||
run: | | ||
poetry config virtualenvs.create true --local | ||
poetry config virtualenvs.in-project true --local | ||
- uses: actions/cache@v3 | ||
name: Define a cache for the virtual environment based on the dependencies lock file | ||
with: | ||
path: ./.venv | ||
key: venv-${{ hashFiles('poetry.lock') }} | ||
- name: Install the project dependencies | ||
run: | | ||
poetry install --with dev | ||
- name: Lint | ||
run: poetry run poe lint | ||
- name: Types | ||
run: poetry run poe type-check | ||
- name: Docs | ||
run: poetry run poe doc-build | ||
- name: Prepare Pages | ||
if: github.ref == 'refs/heads/main' | ||
run: | | ||
mv docs/_build/html/* public/ | ||
- name: Deploy Pages | ||
uses: JamesIves/[email protected] | ||
if: github.ref == 'refs/heads/main' | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages | ||
FOLDER: public | ||
TARGET_FOLDER: . | ||
CLEAN: true | ||
SINGLE_COMMIT: true | ||
{%- endraw %} |
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
48 changes: 48 additions & 0 deletions
48
{{cookiecutter.project_name}}/.github/workflows/pytest.yml
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 @@ | ||
name: Ubuntu | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
cpu: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.head_commit.message, 'ci skip')" | ||
strategy: | ||
matrix: | ||
python-version: [{{cookiecutter.python_version}}] | ||
{% raw -%} | ||
steps: | ||
- name: Cancel previous run | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# use poetry and cache installed packages, see https://github.com/marketplace/actions/python-poetry-action | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v2 | ||
- name: Setup a local virtual environment (if no poetry.toml file) | ||
run: | | ||
poetry config virtualenvs.create true --local | ||
poetry config virtualenvs.in-project true --local | ||
- uses: actions/cache@v3 | ||
name: Define a cache for the virtual environment based on the dependencies lock file | ||
with: | ||
path: ./.venv | ||
key: venv-${{ hashFiles('poetry.lock') }} | ||
- name: Install the project dependencies | ||
run: | | ||
poetry install --with dev --extras "envpool" | ||
- name: Test with pytest | ||
run: poetry run poe test | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV }} | ||
file: ./coverage.xml | ||
flags: unittests | ||
name: codecov-umbrella | ||
fail_ci_if_error: false | ||
{%- endraw %} |
42 changes: 42 additions & 0 deletions
42
{{cookiecutter.project_name}}/.github/workflows/windows_mac_test.yml
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,42 @@ | ||
name: Windows/MacOS | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
cpu-extra: | ||
runs-on: ${{ matrix.os }} | ||
if: "!contains(github.event.head_commit.message, 'ci skip')" | ||
strategy: | ||
matrix: | ||
os: [macos-latest, windows-latest] | ||
python-version: [{{cookiecutter.python_version}}] | ||
{% raw -%} | ||
steps: | ||
- name: Cancel previous run | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
# use poetry and cache installed packages, see https://github.com/marketplace/actions/python-poetry-action | ||
- name: Install poetry | ||
uses: abatilo/actions-poetry@v2 | ||
- name: Setup a local virtual environment (if no poetry.toml file) | ||
run: | | ||
poetry config virtualenvs.create true --local | ||
poetry config virtualenvs.in-project true --local | ||
- uses: actions/cache@v3 | ||
name: Define a cache for the virtual environment based on the dependencies lock file | ||
with: | ||
path: ./.venv | ||
key: venv-${{ hashFiles('poetry.lock') }} | ||
- name: Install the project dependencies | ||
# ugly as hell, but well... | ||
# see https://github.com/python-poetry/poetry/issues/7611 | ||
run: poetry install --with dev || poetry install --with dev || poetry install --with dev | ||
- name: Test with pytest | ||
run: poetry run poe test-subset | ||
{%- endraw %} |
Empty file.
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