Skip to content

[ARC-20] Reference implementation #1124

[ARC-20] Reference implementation

[ARC-20] Reference implementation #1124

Workflow file for this run

name: Continuous Integration
on:
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
- edited
jobs:
save-pr:
name: Save PR Number
runs-on: ubuntu-latest
steps:
- name: Save PR number
env:
PR_NUMBER: ${{ github.event.number }}
PR_SHA: ${{ github.event.pull_request.head.sha }}
MERGE_SHA: ${{ github.sha }}
run: |
mkdir -p ./pr
echo $PR_NUMBER > ./pr/pr_number
echo $PR_SHA > ./pr/pr_sha
echo $MERGE_SHA > ./pr/merge_sha
- name: Upload PR Number
uses: actions/upload-artifact@v3
with:
name: pr_number
path: pr/
htmlproofer:
name: HTMLProofer
runs-on: ubuntu-latest
steps:
- name: Checkout ARC Repository
uses: actions/checkout@v4
- name: Install OpenSSL
run: sudo apt-get update && sudo apt-get install -y libcurl4-openssl-dev
- name: Install Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.6.0
bundler-cache: true
- name: Build Website
run: |
bundle exec jekyll doctor
bundle exec jekyll build
- name: HTML Proofer
run: bundle exec htmlproofer ./_site --check-html --check-opengraph --report-missing-names --log-level=:debug --assume-extension --empty-alt-ignore --timeframe=6w --disable-external
- name: DNS Validator
run: bundle exec github-pages health-check
codespell:
name: CodeSpell
runs-on: ubuntu-latest
steps:
- name: Checkout ARC Repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- name: Run CodeSpell
uses: codespell-project/actions-codespell@2391250ab05295bddd51e36a8c6295edb6343b0e
with:
check_filenames: true
ignore_words_file: .codespell-whitelist
skip: .git,Gemfile.lock,**/*.png,**/*.gif,**/*.jpg,**/*.svg,.codespell-whitelist,vendor,_site,_config.yml,style.css
only_warn: 1
arcw-validator:
name: ARC Walidator
runs-on: ubuntu-latest
steps:
- name: Checkout ARC Repository
uses: actions/checkout@2541b1294d2704b0964813337f33b291d3f8596b
- uses: algorandfoundation/arcw-action@dist
id: arcw
with:
token: ${{ secrets.GITHUB_TOKEN }}
unchecked: 0000
check-path:
name: Check for New Files
runs-on: ubuntu-latest
outputs:
target_path: ${{ steps.check_new_files.outputs.path }}
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Identify Target Path
id: check_new_files
run: |
# Extract added or renamed files matching the pattern
file=$(git diff --name-status origin/main | grep -E '^A|R' | sed -n 's/^[A-Z][0-9]*[[:space:]]\+\([^[:space:]]\+\)$/\1/p' | grep -E '^assets/[^/]+/smart_contracts/[^/]+/contract\.py$' | head -n 1)
# If a match is found, extract its parent directory
if [ -n "$file" ]; then
path=$(dirname "$file")
echo "::set-output name=path::$path"
else
echo "::set-output name=path::"
fi
validate:
name: Validate
needs: check-path
if: needs.check-path.outputs.target_path != ''
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Change Working Directory
run: cd ${{ needs.check-path.outputs.target_path }}
- 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 algokit
- name: Start LocalNet
run: algokit localnet start
- name: Bootstrap dependencies
run: algokit project bootstrap all
- name: Configure git
shell: bash
run: |
git config --global user.email "[email protected]" && git config --global user.name "github-actions"
- name: Audit python dependencies
run: algokit project run audit
- name: Lint and format python dependencies
run: algokit project run lint
- name: Run tests
shell: bash
run: |
set -o pipefail
algokit project run test
- name: Build smart contracts
run: algokit project run build
- name: Scan TEAL files for issues
run: algokit project run audit-teal
- name: Check output stability of the smart contracts
run: algokit project run ci-teal-diff
- name: Run deployer against LocalNet
run: algokit project deploy localnet