Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs build workflow #27

Merged
merged 26 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
coverage:
status:
project:
default:
target: 60%
threshold: 5%
if_ci_failed: error
43 changes: 43 additions & 0 deletions .github/workflows/build-codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build-codecov-docs

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
run:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry lock --no-update
poetry install --with test
pip install pytest
pip install pytest-cov
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't pytest and pytest-cov come with poetry install --with test?


- name: Run tests and collect coverage
run: pytest --cov tests

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
env_vars: OS,PYTHON
files: ./coverage.xml
name: Coverage Report with codecov overview
fail_ci_if_error: true
verbose: true
23 changes: 23 additions & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Docs Build Successfully on PR Check"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ammaraskar/sphinx-action@0.4
with:
docs-folder: "docs/"
pre-build-command: pip install -U sphinx sphinx-rtd-theme
- uses: actions/upload-artifact@v4
with:
name: UserGuideHTML
path: "docs/build/html/"
43 changes: 43 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: flake8 Lint

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

workflow_dispatch:

jobs:
flake8-lint:
runs-on: ubuntu-latest
name: Flake8 Lint
steps:
- name: Check out
uses: actions/checkout@v3

- name: Set up Python environment
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry lock --no-update
poetry install
pip install black
pip install isort
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't Black and isort come with poetry install --with dev?


- name: Run Black
run: black ./ --config pyproject.toml

- name: Run Isort
run: isort .

- name: Setup flake8 annotations
uses: rbialon/flake8-annotations@v1

- name: Link and annotate with Flake8
uses: py-actions/flake8@v2
198 changes: 142 additions & 56 deletions poetry.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ click = "^8.1.7"

[tool.poetry.group.test.dependencies]
pytest = "^8.0.0"
pytest-cov = "^4.1.0"

[tool.poetry.group.docs.dependencies]
sphinx = "^7.2.6"
Expand Down
29 changes: 29 additions & 0 deletions tests/dummy_test/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
def test_dummy():
assert True

def test_another_dummy():
assert False, "This test intentionally fails"

def test_addition():
assert 1 + 1 == 2

def test_subtraction():
assert 5 - 3 == 2

def test_multiplication():
assert 2 * 3 == 6

def test_division():
assert 6 / 3 == 2

def test_strings():
assert "hello" == "hello"

def test_lists():
assert [1, 2, 3] == [1, 2, 3]

def test_dicts():
assert {"key": "value"} == {"key": "value"}

def test_none():
assert None is None
Loading