-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Getting Started Test to the pipeline
- Loading branch information
1 parent
9c7e68a
commit b505dcc
Showing
1 changed file
with
57 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Test the getting start steps | ||
|
||
# run CI on pushes to main, and on all PRs (even the ones that target other | ||
# branches) | ||
|
||
on: | ||
push: | ||
branches: [$default-branch] | ||
pull_request: | ||
|
||
jobs: | ||
getting_started: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Use Node.js 18 | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "18" | ||
- name: Creating Your Dapp From a Template | ||
run: yarn create @agoric/dapp demo | ||
- name: Change directory | ||
run: cd demo | ||
- name: yarn install | ||
run: yarn | ||
- name: yarn start:docker | ||
run: yarn start:docker | ||
- name: yarn docker:logs | ||
run: yarn docker:logs | ||
- name: yarn build | ||
run: yarn build | ||
# Borrowed from https://github.com/DCFoundation/cosmos-proposal-builder/blob/main/.github/workflows/pr.yml#L43-L61 | ||
- name: Wait for Docker container to be ready | ||
run: | | ||
timeout 300 bash -c ' | ||
TARGET_HEIGHT=1111 | ||
SLEEP=10 | ||
echo "Waiting for the Agoric service to be fully ready..." | ||
echo "Target block height: $TARGET_HEIGHT" | ||
while true; do | ||
response=$(curl --silent http://localhost:26657/abci_info); | ||
height=$(echo $response | jq -r ".result.response.last_block_height | tonumber"); | ||
if [ "$height" -ge $TARGET_HEIGHT ]; then | ||
echo "Service is ready! Last block height: $height"; | ||
break; | ||
else | ||
echo "Waiting for last block height to reach $TARGET_HEIGHT. Current height: $height"; | ||
fi; | ||
sleep $SLEEP; | ||
done | ||
' | ||
- name: yarn start:contract | ||
run: yarn start:contract | ||
- name: verify contracts started onchain | ||
run: | | ||
curl http://localhost:1317/agoric/vstorage/data/published.agoricNames.instance | grep sellConcertTickets | ||
curl http://localhost:1317/agoric/vstorage/data/published.agoricNames.instance | grep swaparoo | ||
curl http://localhost:1317/agoric/vstorage/data/published.agoricNames.instance | grep postalService |