Skip to content

chore(deps): update cryptography requirement from <48,>=44.0.1 to >=4… #1

chore(deps): update cryptography requirement from <48,>=44.0.1 to >=4…

chore(deps): update cryptography requirement from <48,>=44.0.1 to >=4… #1

name: Secondary PR Check - Hiero Solo Integration & Unit Tests
on:
push:
branches:
- "main"
paths-ignore:
- "**/*.md"
- "docs/**"
- "examples/**"
- "tck/**"
- "tests/fuzz/**"
- ".github/**"
- "!.github/workflows/pr-check-secondary-unit-integration-test.yml"
pull_request:
paths-ignore:
- "**/*.md"
- "docs/**"
- "examples/**"
- "tck/**"
- "tests/fuzz/**"
- ".github/**"
- "!.github/workflows/pr-check-secondary-unit-integration-test.yml"
workflow_dispatch: {}
permissions:
contents: read
concurrency:
group: pr-check-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
name: Unit Tests (Python ${{ matrix.python-version }})
runs-on: ${{ (github.repository_owner != 'hiero-ledger' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)) && 'ubuntu-latest' || 'hl-sdk-py-lin-md' }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Generate Proto Files
run: uv run generate_proto.py
- name: Run unit tests
id: unit
continue-on-error: true
shell: bash
run: |
set -o pipefail
echo "🚀 Running unit tests..."
set +e
uv run pytest tests/unit -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_unit.log
pytest_exit=${PIPESTATUS[0]}
set -e
echo "exit_code=$pytest_exit" >> "$GITHUB_OUTPUT"
if [ $pytest_exit -ne 0 ]; then
echo "❌ Some unit tests failed"
grep -E 'FAILED |ERROR ' result_unit.log || true
else
echo "✅ All unit tests passed"
fi
- name: Fail job if unit tests failed
if: steps.unit.outputs.exit_code != '0'
shell: bash
run: |
echo "❌ Unit tests failed. See logs above."
exit 1
integration-tests:
name: Integration Tests (Python ${{ matrix.python-version }})
runs-on: ${{ (github.repository_owner != 'hiero-ledger' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)) && 'ubuntu-latest' || 'hl-sdk-py-lin-md' }}
timeout-minutes: 20
needs:
- unit-tests
if: needs.unit-tests.result == 'success'
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
with:
enable-cache: true
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Generate Proto Files
run: uv run generate_proto.py
- name: Prepare Hiero Solo
id: solo
uses: hiero-ledger/hiero-solo-action@328bc84c3b00a990a151418144fd682a4eb76ea6 # v0.19.0
with:
installMirrorNode: true
soloVersion: v0.65.0
mirrorNodeVersion: v0.153.0
hieroVersion: v0.73.0
- name: Run integration tests
id: integration
continue-on-error: true
shell: bash
env:
OPERATOR_ID: ${{ steps.solo.outputs.accountId }}
OPERATOR_KEY: ${{ steps.solo.outputs.privateKey }}
ADMIN_KEY: ${{ steps.solo.outputs.privateKey }}
PUBLIC_KEY: ${{ steps.solo.outputs.publicKey }}
NETWORK: solo
run: |
set -o pipefail
echo "🚀 Running integration tests..."
set +e
uv run --with pytest-xdist pytest -n 2 --dist=loadfile tests/integration -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_integration.log
pytest_exit=${PIPESTATUS[0]}
set -e
echo "exit_code=$pytest_exit" >> "$GITHUB_OUTPUT"
if [ $pytest_exit -ne 0 ]; then
echo "❌ Some integration tests failed"
grep -E 'FAILED |ERROR ' result_integration.log || true
else
echo "✅ All integration tests passed"
fi
- name: Fail job if integration tests failed
if: steps.integration.outputs.exit_code != '0'
shell: bash
run: |
echo "❌ Integration tests failed. See logs above."
exit 1
test-summary:
name: Test Results Summary
runs-on: ${{ (github.repository_owner != 'hiero-ledger' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork)) && 'ubuntu-latest' || 'hl-sdk-py-lin-md' }}
needs:
- unit-tests
- integration-tests
if: always()
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@8d3c67de8e2fe68ef647c8db1e6a09f647780f40 # v2.19.0
with:
egress-policy: audit
- name: Print summary and fail when any test job failed
shell: bash
run: |
unit_result="${{ needs.unit-tests.result }}"
integration_result="${{ needs.integration-tests.result }}"
echo ""
echo "==================== TEST SUMMARY ===================="
any_failed=false
if [ "$unit_result" = "success" ]; then
echo "✅ Unit tests passed"
else
echo "❌ Unit tests FAILED"
any_failed=true
fi
if [ "$integration_result" = "success" ]; then
echo "✅ Integration tests passed"
elif [ "$integration_result" = "skipped" ] && [ "$unit_result" != "success" ]; then
echo "⏭️ Integration tests skipped (unit tests failed first)"
else
echo "❌ Integration tests FAILED"
any_failed=true
fi
echo "======================================================"
echo ""
if [ "$any_failed" = true ]; then
echo "❌ Some tests failed. Failing workflow."
exit 1
else
echo "✅ All tests passed!"
fi