Skip to content

Commit

Permalink
refactor: ensure tests are run against the lastet localnet images
Browse files Browse the repository at this point in the history
  • Loading branch information
boblat committed Jan 9, 2025
1 parent 21b2c4b commit 31baa5e
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 22 deletions.
22 changes: 11 additions & 11 deletions .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
contents: write
packages: read
env:
DRY_RUN: ${{ inputs.dry_run && '--noop' || '' }}
DRY_RUN: ${{ inputs.dry_run && '--noop' || '' }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -83,11 +83,11 @@ jobs:
- name: pre-commit and pytest
if: inputs.run_checks
run: |
set -o pipefail
source $(poetry env info --path)/bin/activate
pre-commit run --all-files && git diff --exit-code
algokit localnet start
pytest
set -o pipefail
source $(poetry env info --path)/bin/activate
pre-commit run --all-files && git diff --exit-code
algokit localnet reset --update
pytest
- name: Get branch name
shell: bash
Expand All @@ -101,7 +101,7 @@ jobs:
if: inputs.bump_version
run: poetry run semantic-release $DRY_RUN --strict version
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

- name: Create Compiler Wheel
if: inputs.compiler_wheel
Expand All @@ -110,9 +110,9 @@ jobs:
- name: Create Stubs Wheel
if: inputs.stubs_wheel
run: |
pushd stubs
poetry build --format wheel
popd
pushd stubs
poetry build --format wheel
popd
- uses: actions/upload-artifact@v4 # upload artifacts so they are retained on the job
with:
Expand All @@ -124,7 +124,7 @@ jobs:
if: steps.get_branch.outputs.branch == 'main' && !inputs.dry_run && inputs.publish_github
run: poetry run semantic-release $DRY_RUN publish
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }}

- name: Publish to PyPI - Compiler
if: steps.get_branch.outputs.branch == 'main' && !inputs.dry_run && inputs.publish_pypi && inputs.compiler_wheel
Expand Down
19 changes: 9 additions & 10 deletions .github/workflows/check-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,28 +25,28 @@ jobs:

- name: Check pre-commits
run: |
set -o pipefail
poetry run pre-commit run --all-files && git diff --exit-code
set -o pipefail
poetry run pre-commit run --all-files && git diff --exit-code
- name: Check generated code
run: |
set -o pipefail
poetry run poe gen && git diff --exit-code
set -o pipefail
poetry run poe gen && git diff --exit-code
- name: Check documentation
run: |
set -o pipefail
poetry run poe docs
set -o pipefail
poetry run poe docs
- name: Check wheels can be built
run: |
set -o pipefail
# build stubs
pushd stubs
poetry build --format wheel
popd
# build compiler
poetry build --format wheel
Expand All @@ -69,7 +69,7 @@ jobs:
run: poetry install --no-interaction --with cicd

- name: Start LocalNet
run: poetry run algokit localnet start
run: poetry run algokit localnet reset --update

- name: pytest + coverage
shell: bash
Expand Down Expand Up @@ -118,7 +118,6 @@ jobs:
if: failure()
run: git diff examples/ test_cases/


compile-all-windows:
runs-on: "windows-latest"
steps:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ puyapy-clientgen = "puyapy.client_gen:main"

[tool.pytest.ini_options]
markers = [
"localnet: test requires `algokit localnet start`",
"localnet: test requires `algokit localnet reset --update`",
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
]
addopts = "-n auto --cov-config=.coveragerc"
Expand Down

0 comments on commit 31baa5e

Please sign in to comment.