Skip to content
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
44 changes: 29 additions & 15 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,44 @@
---
name: Codecov Coverage Report
name: "Codecov Coverage Report"

on: # yamllint disable-line rule:truthy
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:
secrets:
CODECOV_TOKEN:
description: "CODECOV Auth Token"
required: true

jobs:
run:
runs-on: ${{ matrix.os }}
# Adding 'timeout-minutes: 10' would prevent jobs from running
# indefinitely if something goes wrong
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest]
os: ["ubuntu-latest"]
python-version: ["3.12"]
steps:
- uses: actions/checkout@main
- name: Setup Python
uses: actions/setup-python@main
- uses: "actions/checkout@main"
- name: "Setup Python"
uses: "actions/setup-python@main"
with:
python-version: ${{ matrix.python-version }}
- name: Install prerequisites
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: "Install prerequisites"
run: |
python -m pip install --upgrade pip setuptools wheel
pip install -r requirements.txt
- name: Install pytest, pytest-cov
- name: "Install pytest, pytest-cov"
run: |
pip install pytest
pip install pytest-cov
Expand All @@ -33,12 +47,12 @@ jobs:
run: |
python -c "import os; print(os.getcwd())"
python -m pytest . --ignore=solutions --log-cli-level=INFO -v --cov-report term-missing --cov --cov-branch --cov-report=xml
- name: List test files
- name: "List test files"
run: |
ls *.xml
# yamllint enable rule:line-length
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5.5.1
- name: "Upload coverage to Codecov"
uses: "codecov/codecov-action@v5.5.1"
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: coverage.xml
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/flake8.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
---
name: "Flake8"
name: "Flake8 Workflow"

on: # yamllint disable-line rule:truthy
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:

permissions:
contents: "read"
Expand All @@ -22,23 +20,26 @@ jobs:
python-version: ["3.12"]
steps:
- uses: "actions/checkout@v5"
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: "~/.cache/pip"
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python ${{ matrix.python-version }}
# This is the version of the action for setting up Python,
# not the Python version.
uses: actions/setup-python@v6
uses: "actions/setup-python@v6"
with:
python-version: ${{ matrix.python-version }}
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
# You can test your matrix by printing the current
# Python version
- name: "Display Python Version"
run: python -c "import sys; print(sys.version)"
run: |
python -c "import sys; print(sys.version)"
- name: "Install Dependencies"
run: |
python -m pip install --upgrade pip
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/lint_test_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: "Main Pipeline"

on: # yamllint disable-line rule:truthy
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: "read"
pull-requests: "read"

jobs:
changed-files:
runs-on: "ubuntu-latest"
outputs:
python_changed: ${{ steps.python-files.outputs.any_changed }}
yaml_changed: ${{ steps.yaml-files.outputs.any_changed }}
steps:
- uses: "actions/checkout@v5"
- name: "Get changed Python files"
id: python-files
uses: "tj-actions/changed-files@v47"
with:
files: |
**/*.py
requirements.txt
.pylintrc
- name: "Get changed YAML files"
id: yaml-files
uses: "tj-actions/changed-files@v47"
with:
files: |
**/*.yml
**/*.yaml

yamllint:
name: "YAML Lint Workflow"
needs:
- "changed-files"
if: needs.changed-files.outputs.yaml_changed == 'true'
uses: "./.github/workflows/yamllint.yml"

ruff:
name: "Ruff Lint and Format"
needs:
- "changed-files"
- "yamllint"
if: needs.changed-files.outputs.python_changed == 'true'
uses: "./.github/workflows/ruff.yml"

pylint:
name: "Pylint Workflow"
needs:
- "changed-files"
- "yamllint"
if: needs.changed-files.outputs.python_changed == 'true'
uses: "./.github/workflows/pylint.yml"

flake8:
name: "Flake8 Workflow"
needs:
- "changed-files"
- "yamllint"
if: needs.changed-files.outputs.python_changed == 'true'
uses: "./.github/workflows/flake8.yml"

pytest:
name: "Pytest Workflow"
needs:
- "ruff"
- "pylint"
- "flake8"
uses: "./.github/workflows/pytest.yml"

codecov:
name: "Codecov Coverage Report"
needs:
- "pytest"
uses: "./.github/workflows/codecov.yml"
secrets:
CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}"
51 changes: 31 additions & 20 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,39 @@
name: Pylint
---
name: "Pylint Workflow"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:

jobs:
build:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
# Adding 'timeout-minutes: 10' would prevent jobs from running
# indefinitely if something goes wrong
timeout-minutes: 10
strategy:
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
- name: Analysing the code with pylint
run: |
python -m pylint --verbose $(find . -name "*.py" ! -path "*/.venv/*" ! -path "*/venv/*") --rcfile=.pylintrc
- uses: "actions/checkout@v5"
- name: Set up Python ${{ matrix.python-version }}
uses: "actions/setup-python@v6"
with:
python-version: ${{ matrix.python-version }}
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install pylint
pip install -r requirements.txt
- name: "Analysing the code with pylint"
run: |
python -m pylint --verbose $(find . -name "*.py" ! -path "*/.venv/*" ! -path "*/venv/*") --rcfile=.pylintrc
56 changes: 32 additions & 24 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,37 @@
name: Pytest Workflow
---
name: "Pytest Workflow"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:

jobs:
test:
runs-on: ubuntu-latest

runs-on: "ubuntu-latest"
# Adding 'timeout-minutes: 10' would prevent jobs from running
# indefinitely if something goes wrong
timeout-minutes: 10
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Set up Python 3.12
uses: actions/setup-python@v6
with:
python-version: '3.12'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest

- name: Run pytest
run: pytest . --verbose --ignore=solutions --log-cli-level=INFO
- name: "Checkout code"
uses: "actions/checkout@v5"
- name: "Set up Python 3.12"
uses: "actions/setup-python@v6"
with:
python-version: "3.12"
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
- name: "Run pytest"
run: |
pytest . --verbose --ignore=solutions --log-cli-level=INFO
45 changes: 29 additions & 16 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,38 @@
name: Ruff Lint and Format
---
name: "Ruff Lint and Format"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
on: # yamllint disable-line rule:truthy
# Makes it reusable; called by other workflows
workflow_call:

jobs:
ruff:
runs-on: ubuntu-latest
runs-on: "ubuntu-latest"
# Adding 'timeout-minutes: 10' would prevent jobs from running
# indefinitely if something goes wrong
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- name: Set up Python 3.12
uses: actions/setup-python@v6
- uses: "actions/checkout@v5"
- name: "Set up Python 3.12"
uses: "actions/setup-python@v6"
with:
python-version: '3.12'
- name: Install Ruff
python-version: "3.12"
- name: "Cache PIP Dependencies"
uses: "actions/cache@v4"
with:
path: ~/.cache/pip
key: |
${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-${{ matrix.python-version }}-
${{ runner.os }}-pip-
- name: "Install Ruff"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Run Ruff lint
run: ruff check --output-format=github .
- name: Run Ruff format check
run: ruff format --check .
- name: "Run Ruff lint"
run: |
ruff check --output-format=github .
- name: "Run Ruff format check"
run: |
ruff format --check .
Loading