Skip to content

Commit

Permalink
Unit testing data model.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paebbels authored Feb 21, 2024
2 parents e0a0321 + d6c4372 commit c09dc8e
Show file tree
Hide file tree
Showing 52 changed files with 8,343 additions and 1,468 deletions.
8 changes: 0 additions & 8 deletions .btd.yml

This file was deleted.

36 changes: 24 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
target-branch: dev
commit-message:
prefix: "[Dependabot]"
labels:
# Maintain Python packages
- package-ecosystem: "pip"
directory: "/"
target-branch: dev
commit-message:
prefix: "[Dependabot]"
labels:
- Dependencies
assignees:
- Paebbels
reviewers:
- Paebbels
schedule:
interval: daily
reviewers:
- Paebbels
schedule:
interval: "daily" # Checks on Monday trough Friday.

# Maintain GitHub Action runners
- package-ecosystem: "github-actions"
directory: "/"
target-branch: dev
commit-message:
prefix: "[Dependabot]"
labels:
- Dependencies
reviewers:
- Paebbels
schedule:
interval: "weekly"
7 changes: 6 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# New Features

* tbd

# Changes
Expand All @@ -9,3 +9,8 @@
# Bug Fixes

* tbd

----------
# Related PRs:

* tbd
230 changes: 135 additions & 95 deletions .github/workflows/Pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,143 +4,183 @@ on:
push:
workflow_dispatch:
schedule:
- cron: '0 0 * * 5'
# Every Friday at 22:00 - rerun pipeline to check for dependency-based issues
- cron: '0 22 * * 5'

jobs:

Params:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r0
UnitTestingParams:
uses: pyTooling/Actions/.github/workflows/Parameters.yml@r1
with:
name: pyEDAA.Reports
python_version_list: "3.8 3.9 3.10 3.11 3.12 pypy-3.8 pypy-3.9 pypy-3.10"
# disable_list: "windows:pypy-3.8 windows:pypy-3.9 windows:pypy-3.10"

UnitTesting:
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r0
needs:
- Params
with:
jobs: ${{ needs.Params.outputs.python_jobs }}
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}
pacboy: >-
python-pip:p
python-wheel:p
python-coverage:p
python-lxml:p
python-ruamel-yaml:p
python-ruamel.yaml.clib:p
Coverage:
uses: pyTooling/Actions/.github/workflows/CoverageCollection.yml@r0
uses: pyTooling/Actions/.github/workflows/UnitTesting.yml@r1
needs:
- Params
- UnitTestingParams
with:
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
secrets:
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}
jobs: ${{ needs.UnitTestingParams.outputs.python_jobs }}
requirements: "-r tests/unit/requirements.txt"
pacboy: "msys/git"
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}

StaticTypeCheck:
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r0
uses: pyTooling/Actions/.github/workflows/StaticTypeCheck.yml@r1
needs:
- Params
- UnitTestingParams
with:
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
requirements: '-r tests/requirements.txt'
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
commands: |
cd pyEDAA
mypy --html-report ../htmlmypy -p Reports
report: 'htmlmypy'
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
touch pyEDAA/__init__.py
mypy --html-report htmlmypy -p pyEDAA.Reports
html_report: 'htmlmypy'
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}

PublishTestResults:
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r0
DocCoverage:
uses: pyTooling/Actions/.github/workflows/CheckDocumentation.yml@r1
needs:
- UnitTesting
- UnitTestingParams
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
directory: sphinx_reports
# fail_below: 70

Package:
uses: pyTooling/Actions/.github/workflows/Package.yml@r0
uses: pyTooling/Actions/.github/workflows/Package.yml@r1
needs:
- Params
- Coverage
- UnitTestingParams
- UnitTesting
with:
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.package }}
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}

Release:
uses: pyTooling/Actions/.github/workflows/Release.yml@r0
if: startsWith(github.ref, 'refs/tags')
PublishCoverageResults:
uses: pyTooling/Actions/.github/workflows/PublishCoverageResults.yml@r1
needs:
- UnitTestingParams
- UnitTesting
- Coverage
- StaticTypeCheck
- Package
with:
# coverage_sqlite_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
# coverage_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
coverage_html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
secrets:
codacy_token: ${{ secrets.CODACY_PROJECT_TOKEN }}

PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r0
if: startsWith(github.ref, 'refs/tags')
PublishTestResults:
uses: pyTooling/Actions/.github/workflows/PublishTestResults.yml@r1
needs:
- Params
- Release
- Package
- UnitTestingParams
- UnitTesting
with:
python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
requirements: -r dist/requirements.txt
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.package }}
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
merged_junit_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}

IntermediateCleanUp:
uses: pyTooling/Actions/.github/workflows/IntermediateCleanUp.yml@r1
needs:
- UnitTestingParams
- PublishCoverageResults
- PublishTestResults
- HTMLDocumentation
with:
sqlite_coverage_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-
xml_unittest_artifacts_prefix: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-

# VerifyDocs:
# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r0
# uses: pyTooling/Actions/.github/workflows/VerifyDocs.yml@r1
# needs:
# - Params
# - UnitTestingParams
# with:
# python_version: ${{ fromJson(needs.Params.outputs.params).python_version }}
# python_version: ${{ needs.UnitTestingParams.outputs.python_version }}

BuildTheDocs:
uses: pyTooling/Actions/.github/workflows/BuildTheDocs.yml@r0

HTMLDocumentation:
uses: pyTooling/Actions/.github/workflows/SphinxDocumentation.yml@r1
needs:
- Params
#- VerifyDocs
- UnitTestingParams
- PublishTestResults
- PublishCoverageResults
# - VerifyDocs
with:
artifact: ${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
unittest_xml_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-ubuntu-native-3.12
coverage_json_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
html_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}

# PDFDocumentation:
# uses: pyTooling/Actions/.github/workflows/LaTeXDocumentation.yml@r1
# needs:
# - UnitTestingParams
# - HTMLDocumentation
# with:
# document: sphinx_reports
# latex_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
# pdf_artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}

PublishToGitHubPages:
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r0
uses: pyTooling/Actions/.github/workflows/PublishToGitHubPages.yml@r1
needs:
- Params
- BuildTheDocs
- Coverage
- UnitTestingParams
- HTMLDocumentation
# - PDFDocumentation
- PublishCoverageResults
- StaticTypeCheck
with:
doc: ${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
coverage: ${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
typing: ${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
doc: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
# coverage: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
typing: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}

ReleasePage:
uses: pyTooling/Actions/.github/workflows/Release.yml@r1
if: startsWith(github.ref, 'refs/tags')
needs:
- Package
- PublishToGitHubPages

PublishOnPyPI:
uses: pyTooling/Actions/.github/workflows/PublishOnPyPI.yml@r1
if: startsWith(github.ref, 'refs/tags')
needs:
- UnitTestingParams
- ReleasePage
with:
python_version: ${{ needs.UnitTestingParams.outputs.python_version }}
requirements: -r dist/requirements.txt
artifact: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
secrets:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

ArtifactCleanUp:
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r0
uses: pyTooling/Actions/.github/workflows/ArtifactCleanUp.yml@r1
needs:
- Params
- UnitTestingParams
- UnitTesting
- Coverage
- StaticTypeCheck
- BuildTheDocs
- PublishToGitHubPages
- HTMLDocumentation
# - PDFDocumentation
- PublishTestResults
- PublishCoverageResults
- PublishToGitHubPages
# - PublishOnPyPI
with:
package: ${{ fromJson(needs.Params.outputs.params).artifacts.package }}
package: ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).package_all }}
remaining: |
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.7
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.8
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.9
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-ubuntu-3.10
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.7
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.8
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.9
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-windows-3.10
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-msys2-3.9
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.7
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.8
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.9
${{ fromJson(needs.Params.outputs.params).artifacts.unittesting }}-macos-3.10
${{ fromJson(needs.Params.outputs.params).artifacts.coverage }}
${{ fromJson(needs.Params.outputs.params).artifacts.typing }}
${{ fromJson(needs.Params.outputs.params).artifacts.doc }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}-*
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_xml }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).unittesting_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_sqlite }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_xml }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_json }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).codecoverage_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).statictyping_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_html }}
${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_latex }}
# ${{ fromJson(needs.UnitTestingParams.outputs.artifact_names).documentation_pdf }}
24 changes: 18 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ __pycache__/
.coverage
.cov
coverage.xml
/report/coverage

# mypy
/report/typing

# pytest
/report/unit

# setuptools
/build/**/*.*
Expand All @@ -15,11 +22,16 @@ coverage.xml
# Dependencies
!requirements.txt

# Sphinx documentation
/doc/_build/
/doc/_theme/
/doc/pyEDAA.Reports/**/*.*
!/doc/pyEDAA.Reports/index.rst
# Sphinx
doc/_build/
doc/pyEDAA.Reports/**/*.*
!doc/pyEDAA.Reports/index.rst

# PyCharm project
# BuildTheDocs
doc/_theme/**/*.*

# IntelliJ project files
/.idea/workspace.xml

# Git files
!.git*
6 changes: 6 additions & 0 deletions .idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c09dc8e

Please sign in to comment.