Skip to content

Commit

Permalink
chore: regen examples
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Mar 8, 2024
1 parent 54bb16c commit 3b2d772
Show file tree
Hide file tree
Showing 66 changed files with 1,047 additions and 1,279 deletions.
Empty file removed examples/generators/.gitkeep
Empty file.
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' }

This file was deleted.

This file was deleted.

This file was deleted.

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 }}
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'

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3b2d772

Please sign in to comment.