Skip to content

Commit 2f4061b

Browse files
committed
fix: Now working end-to-end
1 parent 1a6c611 commit 2f4061b

File tree

86 files changed

+903
-1606
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+903
-1606
lines changed

examples/production/.algokit.toml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ path = ".algokit/generators/create_env_file"
1111

1212
[project]
1313
type = 'contract'
14-
name = 'production_python'
14+
name = 'production'
1515
artifacts = 'smart_contracts/artifacts'
1616

1717
[project.deploy]
18-
command = "poetry run python -m smart_contracts deploy"
18+
command = "npm run deploy:ci"
1919
environment_secrets = [
2020
"DEPLOYER_MNEMONIC",
2121
"DISPENSER_MNEMONIC",
@@ -25,20 +25,19 @@ environment_secrets = [
2525
environment_secrets = []
2626

2727
[project.run]
28-
# Commands intented for use locally and in CI
28+
# Commands intended for use locally and in CI
2929
build = { commands = [
30-
'poetry run python -m smart_contracts build',
30+
'npm run build',
3131
], description = 'Build all smart contracts in the project' }
3232
test = { commands = [
33-
'poetry run pytest',
34-
], description = 'Run smart contract tests' }
33+
'npm run test',
34+
], description = 'Run smart contract tests using vitest' }
3535
audit = { commands = [
36-
'poetry run pip-audit',
37-
], description = 'Audit with pip-audit' }
36+
'npm run audit',
37+
], description = 'Audit with better-npm-audit' }
3838
lint = { commands = [
39-
'poetry run black --check --diff .',
40-
'poetry run ruff check .',
41-
'poetry run mypy',
39+
'npm run lint',
40+
'npm run format',
4241
], description = 'Perform linting' }
4342
audit-teal = { commands = [
4443
# 🚨 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.

examples/production/.editorconfig

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,3 @@ indent_style = space
55
indent_size = 2
66
end_of_line = lf
77
insert_final_newline = true
8-
9-
[*.py]
10-
indent_size = 4

examples/production/.github/workflows/production-python-cd.yaml renamed to examples/production/.github/workflows/production-cd.yaml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release production_python
1+
name: Release production
22

33
on:
44
workflow_call:
@@ -8,30 +8,27 @@ on:
88

99
jobs:
1010
validate:
11-
name: Validate production_python
12-
uses: ./.github/workflows/production-python-ci.yaml
11+
name: Validate production
12+
uses: ./.github/workflows/production-ci.yaml
1313
deploy-testnet:
14-
runs-on: "ubuntu-latest"
14+
runs-on: 'ubuntu-latest'
1515
needs: validate
1616
environment: contract-testnet
1717
steps:
1818
- name: Checkout source code
1919
uses: actions/checkout@v4
2020

21-
- name: Install poetry
22-
run: pipx install poetry
23-
24-
- name: Set up Python 3.12
25-
uses: actions/setup-python@v5
21+
- name: Use Node.js lts
22+
uses: actions/setup-node@v3
2623
with:
27-
python-version: "3.12"
28-
cache: "poetry"
24+
node-version: lts
25+
cache: 'npm'
2926

3027
- name: Install algokit
3128
run: pipx install algokit
3229

3330
- name: Bootstrap dependencies
34-
run: algokit project bootstrap all
31+
run: algokit project bootstrap all
3532

3633
- name: Configure git
3734
shell: bash
@@ -40,7 +37,7 @@ jobs:
4037
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
4138
4239
- name: Deploy to testnet
43-
run: algokit project deploy testnet
40+
run: algokit project deploy testnet
4441
env:
4542
# This is the account that becomes the creator of the contract
4643
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,70 @@
1-
name: Validate production_python
1+
name: Validate production
22

33
on:
44
workflow_call:
55
pull_request:
66

77
jobs:
88
validate:
9-
runs-on: "ubuntu-latest"
9+
runs-on: 'ubuntu-latest'
1010
steps:
1111
- name: Checkout source code
1212
uses: actions/checkout@v4
1313

14-
- name: Install poetry
15-
run: pipx install poetry
14+
- name: Use Node.js lts
15+
uses: actions/setup-node@v3
16+
with:
17+
node-version: lts
18+
cache: 'npm'
1619

1720
- name: Set up Python 3.12
1821
uses: actions/setup-python@v5
1922
with:
20-
python-version: "3.12"
21-
cache: "poetry"
23+
python-version: '3.12'
24+
cache: 'poetry'
2225

2326
- name: Install algokit
2427
run: pipx install algokit
2528

29+
- name: Install puya compiler
30+
run: pipx install puya
31+
2632
- name: Start LocalNet
2733
run: algokit localnet start
2834

2935
- name: Bootstrap dependencies
30-
run: algokit project bootstrap all
36+
run: algokit project bootstrap all
3137

3238
- name: Configure git
3339
shell: bash
3440
run: |
3541
# set git user and email as test invoke git
3642
git config --global user.email "actions@github.com" && git config --global user.name "github-actions"
3743
38-
- name: Audit python dependencies
39-
run: algokit project run audit
44+
- name: Audit dependencies
45+
run: algokit project run audit
4046

41-
- name: Lint and format python dependencies
42-
run: algokit project run lint
47+
- name: Lint and format
48+
run: algokit project run lint
4349

4450
- name: Run tests
4551
shell: bash
4652
run: |
4753
set -o pipefail
48-
algokit project run test
54+
algokit project run test
4955
5056
- name: Build smart contracts
51-
run: algokit project run build
57+
run: algokit project run build
5258

5359
- name: Scan TEAL files for issues
54-
run: algokit project run audit-teal
60+
run: algokit project run audit-teal
5561

5662
# # Uncomment to enable TEAL static analysis with snapshoting using Tealer package
5763
# # Would first require running locally using audit-teal command and committing the snapshots into source control
5864
# # Please note, tealer has a known bug that may result in large snapshot file sizes, track resolution here:
5965
# # https://github.com/crytic/tealer/issues/101
6066
# - name: Check output stability of the smart contracts
61-
# run: algokit project run ci-teal-diff
67+
# run: algokit project run ci-teal-diff
6268

6369
- name: Run deployer against LocalNet
64-
run: algokit project deploy localnet
70+
run: algokit project deploy localnet

0 commit comments

Comments
 (0)