Skip to content
This repository has been archived by the owner on Nov 27, 2024. It is now read-only.

Commit

Permalink
chore: regenerating test artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Dec 8, 2023
1 parent 4583b78 commit ba4b436
Show file tree
Hide file tree
Showing 39 changed files with 670 additions and 25 deletions.
2 changes: 1 addition & 1 deletion tests_generated/test_default_parameters/.algokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "npm run deploy:ci"
Expand Down
2 changes: 1 addition & 1 deletion tests_generated/test_ide_jetbrains-False/.algokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
2 changes: 1 addition & 1 deletion tests_generated/test_ide_jetbrains-True/.algokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
2 changes: 1 addition & 1 deletion tests_generated/test_ide_vscode-False/.algokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
2 changes: 1 addition & 1 deletion tests_generated/test_ide_vscode-True/.algokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
2 changes: 1 addition & 1 deletion tests_generated/test_preset_name-production/.algokit.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[algokit]
min_version = "v1.4.0"
min_version = "v1.7.3"

[deploy]
command = "poetry run python -m smart_contracts deploy"
Expand Down
25 changes: 25 additions & 0 deletions tests_generated/test_preset_name-production/.copier-answers.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: <commit>
_src_path: <src>
algod_port: 4001
algod_server: http://localhost
algod_token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
author_email: None
author_name: None
contract_name: hello_world
deployment_language: python
ide_vscode: true
indexer_port: 8980
indexer_server: http://localhost
indexer_token: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
preset_name: production
project_name: test_preset_name-production
python_linter: ruff
use_dispenser: false
use_github_actions: true
use_pre_commit: true
use_python_black: true
use_python_mypy: true
use_python_pip_audit: true
use_python_pytest: true

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# this file contains algorand network settings for interacting with testnet via algonode
ALGOD_SERVER=https://testnet-api.algonode.cloud
INDEXER_SERVER=https://testnet-idx.algonode.cloud
1 change: 1 addition & 0 deletions tests_generated/test_preset_name-production/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Continuous Delivery of Smart Contract

on:
push:
branches:
- main

concurrency: release

jobs:
ci-check:
name: Perform Checks
uses: ./.github/workflows/checks.yaml

deploy-testnet:
runs-on: 'ubuntu-latest'
needs: ci-check
environment: Test
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'

- name: Install algokit
run: pipx install algokit

- name: Bootstrap dependencies
run: algokit bootstrap all

- 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
env:
# This is the account that becomes the creator of the contract.
# Since we are not using the optional dispenser account (via DISPENSER_MNEMONIC),
# it must also be funded with enough Algos to deploy and fund the smart contracts created
DEPLOYER_MNEMONIC: ${{ secrets.DEPLOYER_MNEMONIC }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Check code base

on:
workflow_call:

jobs:
checks:
runs-on: 'ubuntu-latest'
steps:
- name: Checkout source code
uses: actions/checkout@v3

- name: Install poetry
run: pipx install poetry

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
cache: 'poetry'

- name: Install algokit
run: pipx install algokit

- name: Start LocalNet
run: algokit localnet start

- name: Bootstrap dependencies
run: algokit bootstrap all

- 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 with pip-audit
run: |
# audit non dev dependencies, no exclusions
poetry export --without=dev > requirements.txt && poetry run pip-audit -r requirements.txt
# audit all dependencies, with exclusions.
# If a vulnerability is found in a dev dependency without an available fix,
# it can be temporarily ignored by adding --ignore-vuln e.g.
# --ignore-vuln "GHSA-hcpj-qp55-gfph" # GitPython vulnerability, dev only dependency
poetry run pip-audit
- name: Check formatting with Black
run: |
# stop the build if there are files that don't meet formatting requirements
poetry run black --check .
- name: Check linting with Ruff
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run ruff .
- name: Check types with mypy
run: poetry run mypy

- name: Run tests
shell: bash
run: |
set -o pipefail
poetry run pytest --junitxml=pytest-junit.xml
- name: Build smart contracts
run: poetry run python -m smart_contracts build

- name: Check output stability of the smart contracts
shell: bash
run: |
# Add untracked files as empty so they come up in diff
git add -N ./smart_contracts/artifacts
# Error out if there are any changes in teal after generating output
git diff --exit-code --minimal ./smart_contracts/artifacts || (echo "::error ::Smart contract artifacts have changed, ensure committed artifacts are up to date" && exit 1);
- name: Run deployer against LocalNet
run: poetry run python -m smart_contracts deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Pull Request validation

on: [pull_request]

jobs:
pr-check:
name: Perform Checks
uses: ./.github/workflows/checks.yaml
Loading

0 comments on commit ba4b436

Please sign in to comment.