Skip to content

feat(github-actions): add inactivity bot phase 2 (stale PR detection) #3092

feat(github-actions): add inactivity bot phase 2 (stale PR detection)

feat(github-actions): add inactivity bot phase 2 (stale PR detection) #3092

Workflow file for this run

name: Hiero Solo Integration & Unit Tests
on:
push:
branches:
- '**'
pull_request: {}
workflow_dispatch: {}
permissions:
contents: read
actions: write
jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout repository
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install uv
uses: astral-sh/setup-uv@2ddd2b9cb38ad8efd50337e8ab201519a34c9f24 # v7.1.1
- name: Install setuptools wheel
run: pip install --upgrade pip setuptools wheel
- name: Install dependencies
run: uv sync --all-extras --dev
- name: Generate Proto Files
run: uv run python generate_proto.py
- name: Prepare Hiero Solo
id: solo
uses: hiero-ledger/hiero-solo-action@fbca3e7a99ce9aa8a250563a81187abe115e0dad # v0.15.0
with:
installMirrorNode: true
- name: Set environment variables
run: |
echo "OPERATOR_ID=${{ steps.solo.outputs.accountId }}"
echo "OPERATOR_KEY=${{ steps.solo.outputs.privateKey }}"
echo "ADMIN_KEY=${{ steps.solo.outputs.privateKey }}"
echo "PUBLIC_KEY=${{ steps.solo.outputs.publicKey }}"
- name: Install your package
run: pip install -e .
- name: Run all 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..."
uv run pytest tests/integration -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_integration.log
pytest_exit=${PIPESTATUS[0]}
echo "integration_failed=$pytest_exit" >> "$GITHUB_OUTPUT"
cat result_integration.log
if [ $pytest_exit -ne 0 ]; then
echo "❌ Some integration tests failed"
else
echo "✅ All integration tests passed"
fi
- name: Run all unit tests
id: unit
continue-on-error: true
shell: bash
run: |
set -o pipefail
echo "🚀 Running unit tests..."
uv run pytest tests/unit -v --disable-warnings --continue-on-collection-errors 2>&1 | tee result_unit.log
pytest_exit=${PIPESTATUS[0]}
echo "unit_failed=$pytest_exit" >> "$GITHUB_OUTPUT"
cat result_unit.log
if [ $pytest_exit -ne 0 ]; then
echo "❌ Some unit tests failed"
else
echo "✅ All unit tests passed"
fi
- name: Fail workflow if any tests failed
shell: bash
run: |
if [ "${{ steps.integration.outputs.integration_failed }}" != "0" ] || [ "${{ steps.unit.outputs.unit_failed }}" != "0" ]; then
echo "❌ Some tests failed. Failing workflow."
exit 1
else
echo "✅ All tests passed!"
fi