generated from algorandfoundation/algokit-beaker-default-template
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54bb16c
commit 3b2d772
Showing
66 changed files
with
1,047 additions
and
1,279 deletions.
There are no files selected for viewing
Empty file.
46 changes: 38 additions & 8 deletions
46
examples/generators/production_puya_smart_contract_python/.algokit.toml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,49 @@ | ||
[algokit] | ||
min_version = "v1.8.0" | ||
|
||
[deploy] | ||
[generate.smart_contract] | ||
description = "Adds new smart contract to existing project" | ||
path = ".algokit/generators/create_contract" | ||
|
||
[project] | ||
type = 'contract' | ||
name = 'production_puya_smart_contract_python' | ||
artifacts = 'smart_contracts/artifacts' | ||
|
||
[project.deploy] | ||
command = "poetry run python -m smart_contracts deploy" | ||
environment_secrets = [ | ||
"DEPLOYER_MNEMONIC", | ||
"DISPENSER_MNEMONIC", | ||
] | ||
|
||
[deploy.localnet] | ||
[project.deploy.localnet] | ||
environment_secrets = [] | ||
|
||
[generate.smart_contract] | ||
description = "Adds new smart contract to existing project" | ||
path = ".algokit/generators/create_contract" | ||
[project.run] | ||
# Commands intented for use locally and in CI | ||
build = { commands = [ | ||
'poetry run python -m smart_contracts build', | ||
], description = 'Build all smart contracts in the project' } | ||
test = { commands = [ | ||
'poetry run pytest', | ||
], description = 'Run smart contract tests' } | ||
audit = { commands = [ | ||
'poetry export --without=dev -o requirements.txt', | ||
'poetry run pip-audit -r requirements.txt', | ||
], description = 'Audit with pip-audit' } | ||
lint = { commands = [ | ||
'poetry run black --check .', | ||
'poetry run ruff .', | ||
'poetry run mypy', | ||
], description = 'Perform linting' } | ||
audit-teal = { commands = [ | ||
# 🚨 IMPORTANT 🚨: For strict TEAL validation, remove --exclude statements. The default starter contract is not for production. Ensure thorough testing and adherence to best practices in smart contract development. This is not a replacement for a professional audit. | ||
'algokit task analyze smart_contracts/artifacts --recursive --force --exclude rekey-to --exclude is-updatable --exclude missing-fee-check --exclude is-deletable --exclude can-close-asset --exclude can-close-account --exclude unprotected-deletable --exclude unprotected-updatable', | ||
], description = 'Audit TEAL files' } | ||
|
||
[project] | ||
type = 'contract' | ||
name = 'production_puya_smart_contract_python' | ||
# Commands indented for CI only, prefixed with `ci-` by convention | ||
ci-teal-diff = { commands = [ | ||
'git add -N ./smart_contracts/artifacts', | ||
'git diff --exit-code --minimal ./smart_contracts/artifacts', | ||
], description = 'Check TEAL files for differences' } |
50 changes: 0 additions & 50 deletions
50
examples/generators/production_puya_smart_contract_python/.github/workflows/cd.yaml
This file was deleted.
Oops, something went wrong.
82 changes: 0 additions & 82 deletions
82
examples/generators/production_puya_smart_contract_python/.github/workflows/checks.yaml
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
examples/generators/production_puya_smart_contract_python/.github/workflows/pr.yaml
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
...uya_smart_contract_python/.github/workflows/production-puya-smart-contract-python-cd.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Release production_puya_smart_contract_python | ||
|
||
on: | ||
workflow_call: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
validate: | ||
name: Validate production_puya_smart_contract_python | ||
uses: ./.github/workflows/production-puya-smart-contract-python-ci.yaml | ||
deploy-testnet: | ||
runs-on: "ubuntu-latest" | ||
needs: validate | ||
environment: contract-testnet | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: "poetry" | ||
|
||
- name: Install algokit | ||
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/orchestration-linking | ||
|
||
- name: Bootstrap dependencies | ||
run: algokit bootstrap all --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Configure git | ||
shell: bash | ||
run: | | ||
# set git user and email as test invoke git | ||
git config --global user.email "[email protected]" && git config --global user.name "github-actions" | ||
- name: Deploy to testnet | ||
run: algokit deploy testnet --project-name 'production_puya_smart_contract_python' | ||
env: | ||
# This is the account that becomes the creator of the contract | ||
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }} | ||
# The dispenser account is used to ensure the deployer account is funded | ||
DISPENSER_MNEMONIC: ${{ secrets.DISPENSER_MNEMONIC }} |
60 changes: 60 additions & 0 deletions
60
...uya_smart_contract_python/.github/workflows/production-puya-smart-contract-python-ci.yaml
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
name: Validate production_puya_smart_contract_python | ||
|
||
on: | ||
workflow_call: | ||
pull_request: | ||
|
||
jobs: | ||
validate: | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- name: Checkout source code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.12" | ||
cache: "poetry" | ||
|
||
- name: Install algokit | ||
run: pipx install git+https://github.com/algorandfoundation/algokit-cli@feat/orchestration-linking | ||
|
||
- name: Start LocalNet | ||
run: algokit localnet start | ||
|
||
- name: Bootstrap dependencies | ||
run: algokit bootstrap all --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Configure git | ||
shell: bash | ||
run: | | ||
# set git user and email as test invoke git | ||
git config --global user.email "[email protected]" && git config --global user.name "github-actions" | ||
- name: Audit python dependencies | ||
run: algokit project run audit --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Lint and format python dependencies | ||
run: algokit project run lint --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Run tests | ||
shell: bash | ||
run: | | ||
set -o pipefail | ||
algokit project run test --project-name 'production_puya_smart_contract_python' | ||
- name: Build smart contracts | ||
run: algokit project run build --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Scan TEAL files for issues | ||
run: algokit project run audit-teal --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Check output stability of the smart contracts | ||
run: algokit project run ci-teal-diff --project-name 'production_puya_smart_contract_python' | ||
|
||
- name: Run deployer against LocalNet | ||
run: algokit project deploy localnet --project-name 'production_puya_smart_contract_python' |
35 changes: 35 additions & 0 deletions
35
...roduction_puya_smart_contract_python/.idea/runConfigurations/Build_Beaker_application.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
37 changes: 37 additions & 0 deletions
37
...ya_smart_contract_python/.idea/runConfigurations/Build_Beaker_application____LocalNet.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.