Skip to content

CI-TESTS

CI-TESTS #1207

Workflow file for this run

---
name: CI-TESTS
# Continuous Integration workflow for post-MATs additional testing, and validating of the project.
#
# Jobs included:
# - COVERAGE: Generates coverage reports on multiple OS and Python versions
# - STYLE: Checks code style and linting compliance
# - INTEGRATION: Performs integration tests on different platforms
# - EXTRAS-FOR-SETUP: Tests legacy setup scripts
# - EXTRAS-FOR-PIP: Validates package dependencies and pip installations
# - DOCS: Builds and lints documentation
# - TOX: Executes tests across Python environments using Tox
#
# Required Secrets:
# - CODECOV_TOKEN: For uploading coverage reports to Codecov
# - CODECLIMATE_TOKEN: For integration with Code Climate
# - CC_TEST_REPORTER_ID: For Code Climate test reporting
on:
workflow_run:
workflows: ["CI-MATs"]
types:
- completed
# Declare default permissions as none.
permissions: {}
jobs:
check_mats:
permissions:
actions: read
pull-requests: read
checks: write
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ github.token }}
outputs:
should_run: ${{ steps.check.outputs.should_run }}
mats_environment: ${{ steps.get_env.outputs.environment }}
steps:
- id: check
run: |
if [[ "${{ github.event.workflow_run.conclusion }}" == "success" ]]; then
echo "should_run=true" >> $GITHUB_OUTPUT
else
echo "should_run=false" >> $GITHUB_OUTPUT
fi
- id: get_env
run: |
ENV_VALUE=$(gh api "${{ github.event.workflow_run.artifacts_url }}" --jq '.environment')
if [[ -n "$ENV_VALUE" ]]; then
echo "environment=$ENV_VALUE" >> $GITHUB_OUTPUT
else
echo "environment=Experimenting" >> $GITHUB_OUTPUT # Default fallback
fi
COVERAGE:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
environment: ${{ needs.check_mats.outputs.mats_environment }}
if: ${{ !cancelled() && (needs.check_mats.outputs.should_run == 'true') }}
needs: [check_mats]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: "en_US.utf-8"
COVERAGE_RCFILE: ./.coveragerc
COV_CORE_SOURCE: ./
COV_CORE_CONFIG: ./.coveragerc
COV_CORE_DATAFILE: ./coverage.xml
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
DEEPSOURCE_DSN: ${{ secrets.DEEPSOURCE_DSN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Fix braindead windows ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Windows' }}
run: python -m pip install --upgrade pip
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
run: |
pip install --upgrade "pip>=24.3.1" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1";
pip install --upgrade -r ./requirements.txt ;
pip install --upgrade -r ./tests/requirements.txt || true ;
pip install --upgrade -r ./docs/requirements.txt || true ;
- name: Install code-climate tools for ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Linux' }}
shell: bash
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || true ;
chmod +x ./cc-test-reporter 2>/dev/null || true ;
./cc-test-reporter before-build || true ;
- name: Install deepsource tools for ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Linux' }}
shell: bash
run: |
(curl https://deepsource.io/cli | sh) || true ;
- name: Pre-Clean
id: clean
run: make -j1 -f Makefile clean || true ;
- name: Generate Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
run: make -f Makefile test-pytest >> $GITHUB_STEP_SUMMARY ;
- name: Upload Python ${{ matrix.python-version }} coverage to Codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
directory: .
flags: multicast,${{ matrix.os }},${{ matrix.python-version }}
name: multicast-github-${{ matrix.os }}-${{ matrix.python-version }}
verbose: true
fail_ci_if_error: false
- name: Upload Python ${{ matrix.python-version }} Artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
path: ./test-reports/
if-no-files-found: ignore
- name: code-climate for ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Linux' }}
shell: bash
run: |
./cc-test-reporter after-build --exit-code 0 || true ;
- name: deepsource for ${{ matrix.python-version }} on ${{ matrix.os }}
if: ${{ !cancelled() && runner.os == 'Linux' }}
shell: bash
run: |
./bin/deepsource report --analyzer test-coverage --key python --value-file ./coverage.xml 2>/dev/null || true ;
- name: Post-Clean
id: post
run: make -j1 -f Makefile clean || true ;
if: ${{ always() }}
STYLE:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
environment: ${{ needs.check_mats.outputs.mats_environment }}
if: ${{ success() && (needs.check_mats.outputs.should_run == 'true') }}
needs: [check_mats]
runs-on: ubuntu-latest
defaults:
run:
shell: bash
timeout-minutes: 10
env:
PYTHON_VERSION: '3.13'
LANG: "en_US.utf-8"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.13"
- name: Install dependencies for python Linters
run: |
pip install --upgrade "pip>=24.3.1" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.2";
pip install --upgrade -r ./requirements.txt ;
pip install --upgrade -r ./tests/requirements.txt || true ;
pip install --upgrade -r ./docs/requirements.txt || true ;
- name: Pre-Clean
id: clean
run: make -j1 -f Makefile clean || true ;
- name: Testing Style
id: style
run: make -j1 -f Makefile test-style >> $GITHUB_STEP_SUMMARY ;
shell: bash
- name: Post-Clean
id: post
run: make -j1 -f Makefile clean || true ;
if: ${{ always() }}
INTEGRATION:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
environment: ${{ needs.check_mats.outputs.mats_environment }}
if: ${{ success() }}
needs: [check_mats, COVERAGE]
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: "en_US.utf-8"
LC_CTYPE: "en_US.utf-8"
COVERAGE_RCFILE: ./.coveragerc
COV_CORE_SOURCE: ./
COV_CORE_CONFIG: ./.coveragerc
COV_CORE_DATAFILE: .coverage
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
run: |
pip install --upgrade "pip>=24.3.1" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1";
pip install --upgrade -r ./requirements.txt ;
pip install --upgrade -r ./tests/requirements.txt || true ;
pip install --upgrade -r ./docs/requirements.txt || true ;
- name: Install Darwin code-climate tools for ${{ matrix.python-version }}
if: ${{ !cancelled() && runner.os != 'Linux' }}
run: |
if [ "$OS" == "macos-latest" ] ; then curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-darwin-amd64 > ./cc-test-reporter || true ; fi ;
if [ "$OS" == "macos-latest" ] ; then chmod +x ./cc-test-reporter 2>/dev/null || true ; fi
if [ "$OS" == "macos-latest" ] ; then ./cc-test-reporter before-build || true ; fi
shell: bash
- name: Install Linux code-climate tools for ${{ matrix.python-version }}
if: ${{ !cancelled() && runner.os == 'Linux' }}
run: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter || curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-arm64 > ./cc-test-reporter || true ;
chmod +x ./cc-test-reporter 2>/dev/null || true ;
./cc-test-reporter before-build || true ;
- name: Pre-Clean
id: clean-prep
run: make -j1 -f Makefile clean ;
- name: Pre-build for Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile build ;
if: ${{ success() }}
- name: Pre-install for Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile user-install || true ;
if: ${{ success() }}
- name: Re-Generate Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
run: |
make -j1 -f Makefile test-pytest ;
cp -vf ./coverage.xml ./test-reports/coverage.xml || true ;
shell: bash
- name: Generate Extra Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
run: |
hash -p ./.github/tool_shlock_helper.sh shlock ;
./tests/check_integration_coverage || echo "::warning file=tests/check_integration_coverage,line=1,endLine=1,title=SKIPPED::SKIP Integration Tests." ;
shell: bash
- name: Upload Python ${{ matrix.python-version }} integration coverage to Codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test-reports/coverage_supplement.xml
directory: .
flags: multicast,${{ matrix.os }},${{ matrix.python-version }}
name: multicast-github-${{ matrix.os }}-${{ matrix.python-version }}
verbose: true
fail_ci_if_error: false
- name: Upload Extra Python ${{ matrix.python-version }} Artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: Integration-Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
path: ./test-reports/
if-no-files-found: ignore
- name: code-climate for ${{ matrix.python-version }}
if: ${{ !cancelled() && runner.os != 'Linux' }}
run: |
if [ "$OS" == "macos-latest" ] ; then ./cc-test-reporter after-build --exit-code 0 || true ; else echo "::warning file=.github/workflows/Tests.yml,line=459,endLine=459,title=SKIPPED::SKIP Code-Climate" ; fi ;
- name: code-climate for ${{ matrix.python-version }}
if: ${{ !cancelled() && runner.os == 'Linux' }}
run: |
./cc-test-reporter after-build --exit-code 0 || true ;
- name: Upload Python ${{ matrix.python-version }} integration test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@9739113ad922ea0a9abb4b2c0f8bf6a4aa8ef820 # v1.0.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test-reports/junit.xml
directory: .
flags: multicast,${{ matrix.os }},${{ matrix.python-version }}
name: multicast-github-${{ matrix.os }}-${{ matrix.python-version }}-test-results
verbose: true
fail_ci_if_error: false
- name: Post-purge
id: post-uninstall
run: make -j1 -f Makefile purge || true ;
if: ${{ !cancelled() }}
- name: Post-Clean
id: post-end
run: make -j1 -f Makefile clean || true ;
if: ${{ !cancelled() }}
EXTRAS-FOR-SETUP:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
environment: ${{ needs.check_mats.outputs.mats_environment }}
if: ${{ success() }}
needs: [COVERAGE, STYLE]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: "en_US.utf-8"
LC_CTYPE: "en_US.utf-8"
COVERAGE_RCFILE: ./.coveragerc
COV_CORE_SOURCE: ./
COV_CORE_CONFIG: ./.coveragerc
COV_CORE_DATAFILE: .coverage
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for python ${{ matrix.python-version }} on ${{ matrix.os }}
run: |
pip install --upgrade "pip>=24.3.1" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1";
pip install -r ./requirements.txt ;
pip install -r ./tests/requirements.txt || true ;
- name: Pre-Clean
id: clean-prep
run: make -j1 -f Makefile clean ;
- name: Pre-build for Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile build ;
if: ${{ success() }}
- name: Pre-install for Python ${{ matrix.python-version }} on ${{ matrix.os }}
run: make -j1 -f Makefile user-install || true ;
if: ${{ success() }}
- name: Generate Extra Legacy Setup Coverage for py${{ matrix.python-version }} on ${{ matrix.os }}
run: |
hash -p ./.github/tool_shlock_helper.sh shlock ;
./tests/check_legacy_setup_coverage || echo "::warning file=tests/check_legacy_setup_coverage,line=1,endLine=1,title=SKIPPED::SKIP Legacy Setup.py Tests." ;
if: ${{ !cancelled() }}
- name: Upload Python ${{ matrix.python-version }} Legacy Setup.py coverage to Codecov
uses: codecov/codecov-action@7f8b4b4bde536c465e797be725718b88c5d95e0e # v5.1.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./test-reports/coverage_setup.xml
directory: .
flags: multicast,${{ matrix.os }},${{ matrix.python-version }}
name: multicast-github-${{ matrix.os }}-${{ matrix.python-version }}
verbose: true
fail_ci_if_error: false
- name: Upload Extra Python ${{ matrix.python-version }} Artifact
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: Legacy_Setup-Test-Report-${{ matrix.os }}-${{ matrix.python-version }}
path: ./test-reports/
if-no-files-found: ignore
- name: Post-purge
id: post-uninstall
run: make -j1 -f Makefile purge || true ;
if: ${{ !cancelled() }}
- name: Post-Clean
id: post-end
run: make -j1 -f Makefile clean || true ;
if: ${{ !cancelled() }}
EXTRAS-FOR-PIP:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
environment: ${{ needs.check_mats.outputs.mats_environment }}
if: ${{ !cancelled() && (needs.check_mats.outputs.mats_environment == 'Testing' || needs.check_mats.outputs.mats_environment == 'Deployment') }}
needs: [COVERAGE, STYLE]
runs-on: ubuntu-latest
defaults:
run:
shell: bash
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
env:
OS: 'ubuntu-latest'
PYTHON_VERSION: ${{ matrix.python-version }}
LANG: "en_US.utf-8"
LC_CTYPE: "en_US.utf-8"
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies for python ${{ matrix.python-version }}
run: |
pip install --upgrade "pip>=24.3.1" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1" "pip-licenses>=5.0.0";
pip install -r ./requirements.txt ;
pip install -r ./tests/requirements.txt || true ;
pip install --upgrade -r ./docs/requirements.txt || true ;
- name: Pre-Clean
id: clean-prep
run: make -j1 -f Makefile clean ;
- name: Test Dependencies with py${{ matrix.python-version }}
run: |
hash -p ./.github/tool_shlock_helper.sh shlock ; export TMPDIR=./ ;
./tests/check_pip ;
shell: bash
if: ${{ !cancelled() }}
- name: Post-purge
id: post-uninstall
run: make -j1 -f Makefile purge || true ;
if: ${{ !cancelled() }}
- name: Post-Clean
id: post-end
run: make -j1 -f Makefile clean || true ;
if: ${{ !cancelled() }}
TOX:
permissions:
actions: read
contents: read
statuses: write
packages: none
pull-requests: read
security-events: none
if: ${{ success() && needs.check_mats.outputs.should_run == 'true' }}
environment: ${{ needs.check_mats.outputs.mats_environment }}
needs: [STYLE, COVERAGE, INTEGRATION]
runs-on: ubuntu-latest
timeout-minutes: 30
env:
OS: 'ubuntu-latest'
PYTHON_VERSION: '3.12'
LANG: 'en_US.utf-8'
CODECLIMATE_REPO_TOKEN: ${{ secrets.CODECLIMATE_TOKEN }}
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0
with:
python-version: "3.12"
- name: Prep Testing Tox
id: prep-tox
run: |
if [ "$OS" == "ubuntu-latest" ] ; then { sudo apt-get update || true ;} ; wait ; { sudo apt-get install --assume-yes python3.10 python3.11 python3.11-venv || echo "::warning file=.github/workflows/Tests.yml,line=677,endLine=677,title=SKIPPED::SKIP Enhanced TOX Tests." ;} ; wait ; fi
- name: Install dependencies for Tox
run: |
pip install --upgrade "pip>=24.3.1" "setuptools>=75.0" "wheel>=0.44" "build>=1.2.1";
pip install --upgrade -r ./requirements.txt ;
pip install --upgrade -r ./tests/requirements.txt || true ;
pip install --upgrade -r ./docs/requirements.txt || true ;
- name: Pre-Clean
id: clean
run: make -j1 -f Makefile clean || true ;
- name: Testing Tox
run: make -j1 -f Makefile test-tox || true ;
- name: Post-Clean
id: post
run: make -j1 -f Makefile clean || true ;
if: ${{ !cancelled() }}