Skip to content

Commit

Permalink
feat: support for latest mainnet release
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev committed Nov 28, 2023
1 parent 3cb3f4d commit 5b10207
Show file tree
Hide file tree
Showing 35 changed files with 16,747 additions and 9,042 deletions.
7 changes: 7 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# this file should contain environment variables specific to algokit localnet
ALGOD_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
ALGOD_SERVER=http://localhost
ALGOD_PORT=4001
INDEXER_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
INDEXER_SERVER=http://localhost
INDEXER_PORT=8980
63 changes: 63 additions & 0 deletions .github/actions/setup-subtopia-registry/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# .github/actions/setup-subtopia-registry/action.yaml
name: "Setup Subtopia Registry"
description: "Setup Subtopia Registry"
inputs:
ssh-key:
description: "SSH Key"
required: true
repository:
description: "Repository"
required: true
path:
description: "Path"
required: true
node-version:
description: "Node Version"
required: true
python-version:
description: "Python Version"
required: true
poetry-version:
description: "Poetry Version"
required: true
runs:
using: "composite"
steps:
- name: Check out registry infra setup
uses: actions/checkout@v4
with:
ssh-key: ${{ inputs.ssh-key }}
repository: ${{ inputs.repository }}
path: ${{ inputs.path }}
fetch-depth: 1

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.python-version }}

- name: Set up Poetry
shell: sh
run: |
pip install pipx
pipx install poetry
- name: Run AlgoKit LocalNet
shell: sh
run: |
cd registry-infra
pipx install algokit
algokit localnet start
- name: Setup localnet registry
shell: sh
env:
LOCALNET_APP_IDS_PATH: ${{ github.workspace }}/.env
CHAIN_TYPE: localnet
run: |
cp .env.template .env
cd registry-infra
poetry install --no-interaction
cat ${{ github.workspace }}/.env
poetry run python3 admin_scripts/deploy_localnet_infra.py
cat ${{ github.workspace }}/.env
2 changes: 1 addition & 1 deletion .github/auto_assign.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
addReviewers: true

# Set to true to add assignees to pull requests
addAssignees: 'author'
addAssignees: "author"

# A list of reviewers to be added to pull requests (GitHub user name)
reviewers:
Expand Down
135 changes: 0 additions & 135 deletions .github/workflows/ci.yaml

This file was deleted.

164 changes: 164 additions & 0 deletions .github/workflows/cicd.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
name: CI / CD

on:
push:
branches:
- main
- release
merge_group:
pull_request:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build

lint:
name: Linting
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Lint
run: npm run lint:scripts

unit-tests:
name: Integration tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node: [18, 20]
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup Subtopia Registry
uses: ./.github/actions/setup-subtopia-registry
with:
ssh-key: ${{ secrets.PRIVATE_SSH_KEY }}
repository: subtopia-algo/subtopia-contracts
path: ./registry-infra
node-version: 18
python-version: ">=3.11 <3.12"
poetry-version: 1.7.1

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Run tests
run: npm run test:integration

- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
if: runner.os == 'Linux' && matrix.node == '18'
with:
fail_ci_if_error: true
token: ${{ secrets.CODECOV_TOKEN }}

deploy-docs:
if: github.ref == 'refs/heads/main'
permissions: write-all
name: Deploy docs
needs: [build, lint, unit-tests]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Build docs
run: npm run docs

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
commit-message: Refreshing documentation 🚀
folder: docs # The folder the action should deploy.

release:
if: github.ref == 'refs/heads/main'
permissions: write-all
name: Release
needs: [build, lint, unit-tests, deploy-docs]
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false # <--- override default gh token

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18
scope: "@subtopia-algo"
cache: "npm"
cache-dependency-path: ./package-lock.json

- name: Install dependencies
run: npm ci

- name: Run build
run: npm run build

- name: release
env:
GITHUB_TOKEN: ${{ secrets.CUSTOM_GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release
Loading

0 comments on commit 5b10207

Please sign in to comment.