docs: add links to Agent and Connect docs #703
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Fadroma (Project) | |
on: [push] | |
jobs: | |
# Here we test creating a project from a TypeScript source checkout of Fadroma, | |
# compiled on demand using the @hackbg/ganesha module loader | |
project-gh: | |
name: pnpm ci | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone with submodules | |
uses: actions/checkout@v4 | |
with: { submodules: recursive } | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2 | |
with: { version: 7.29.1 } | |
- name: Setup Node 19 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "19" | |
check-latest: true | |
cache: pnpm | |
cache-dependency-path: pnpm-lock.yaml | |
- name: Run pnpm ci | |
env: | |
FORCE_COLOR: 2 | |
run: | | |
sudo apt install -y wabt binaryen cloc | |
mkdir -p wasm | |
rustup default 1.69 | |
rustup target add wasm32-unknown-unknown --toolchain 1.69 | |
pnpm --version | |
pnpm i --frozen-lockfile | |
FORCE_COLOR=1 FADROMA_BUILD_RAW=1 TEMP="$(dirname $(pwd))" TMP="$(dirname $(pwd))" pnpm run ci | |
- name: Create, build, and deploy project | |
env: | |
FORCE_COLOR: 2 | |
run: | | |
../fadroma/fadroma.cli.cjs create testproject test1 test2 | |
cd testproject | |
cat package.json | |
cat fadroma.yml | |
cat api.ts | |
cat ops.ts | |
echo '{"name":"testproject","main":"api.ts","type":"module","version":"0.1.0","dependencies":{"@fadroma/agent":"link:../fadroma/agent","@fadroma/scrt":"link:../fadroma/scrt"},"devDependencies":{"@hackbg/fadroma":"link:../fadroma","@hackbg/ganesha":"link:../fadroma/ensuite/ganesha","typescript":"^5"},"scripts":{"build":"fadroma build","status":"fadroma status","mocknet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtMocknet fadroma","devnet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtDevnet fadroma","testnet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtTestnet fadroma","mainnet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtMainnet fadroma"}}' > package.json | |
pnpm i | |
pnpm build | |
pnpm mocknet deploy | |
pnpm devnet deploy | |
pnpm devnet status | |
pnpm devnet export | |
pnpm devnet reset | |
cd .. | |
rm -rf testproject | |
# Here we test creating a project from a source checkout of Fadroma | |
# that has been pre-compiled to JavaScript using @hackbg/ubik | |
project-gh-compiled: | |
name: Create and build a project by compiled checkout | |
runs-on: ubuntu-latest | |
steps: | |
- name: Clone with submodules | |
uses: actions/checkout@v4 | |
with: { submodules: recursive } | |
- name: Setup PNPM | |
uses: pnpm/action-setup@v2 | |
with: { version: 7.29.1, run_install: false } | |
- name: Setup Node 19 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "19" | |
check-latest: true | |
cache: pnpm | |
cache-dependency-path: pnpm-lock.yaml | |
- name: Setup Rust (stable, wasm32-unknown-unknown) | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: 1.69.0 | |
target: wasm32-unknown-unknown | |
override: true | |
- name: Build Fadroma to NPM equivalent | |
env: | |
FORCE_COLOR: 2 | |
run: | | |
pnpm i # install with dev dependencies | |
pnpm exec ubik compile # compile to js, don't typecheck or run tests | |
sudo ln -s `which true` /usr/local/bin/husky # stub husky | |
pnpm i -P # remove dev dependencies | |
- name: Create project | |
env: | |
FORCE_COLOR: 2 | |
run: | | |
sudo apt install -y wabt binaryen | |
export FADROMA="$(pwd)" | |
cd .. | |
npx ./fadroma create myproject mycontract1 mycontract2 | |
cd myproject | |
cat package.json | |
echo '{"name":"myproject","main":"api.ts","type":"module","version":"0.1.0","dependencies":{"@fadroma/agent":"link:../fadroma/agent","@fadroma/scrt":"link:../fadroma/scrt"},"devDependencies":{"@hackbg/fadroma":"link:../fadroma","@hackbg/ganesha":"link:../fadroma/ensuite/ganesha","typescript":"^5"},"scripts":{"build":"fadroma build","status":"fadroma status","mocknet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtMocknet fadroma","devnet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtDevnet fadroma","testnet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtTestnet fadroma","mainnet":"FADROMA_PROJECT=./ops.ts FADROMA_CHAIN=ScrtMainnet fadroma"}}' > package.json | |
cat package.json | |
pnpm i --no-frozen-lockfile | |
cat fadroma.yml | |
cat api.ts | |
cat ops.ts | |
npm run build | |
npm run mocknet deploy | |
ls -al state | |
ls -al state/* | |
npm run devnet deploy | |
npm run devnet export | |
npm run devnet reset | |
cd .. | |
rm -rf myproject | |
# Here we test creating a project from the published NPM package. | |
# `npm/` tags are automatically pushed by `@hackbg/ubik` after publishing | |
# the packages to NPM for real, so this job only runs on tag pushes. | |
# TODO: Add retry in case NPM caches are slow to refresh after publication. | |
project-npm: | |
if: "startsWith(github.ref, 'refs/tags/npm/')" | |
name: Create and build a project by published package | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [16, 20] | |
steps: | |
- name: Setup Node ${{matrix.node-version}} | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "${{matrix.node-version}}" | |
check-latest: true | |
- name: Setup Rust (stable, wasm32-unknown-unknown) | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
override: true | |
- name: Create project through NPX | |
run: | | |
sudo apt install -y wabt binaryen | |
npx @hackbg/fadroma@latest create myproject mycontract1 mycontract2 | |
cd myproject | |
cat package.json | |
cat fadroma.yml | |
cat api.ts | |
cat ops.ts | |
npm run build | |
npm run mocknet deploy | |
npm run devnet deploy | |
npm run devnet export | |
npm run devnet reset |