fix: duplicate import in transaction.py (#857) #185
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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@95d9a5deda9de15063e7595e9719c11c38c90ae2 # v2.13.2 | |
| with: | |
| egress-policy: audit | |
| - name: Checkout repository | |
| uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 | |
| - 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 |