automate liquidation testing #29
Workflow file for this run
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: Liquidation Indexing | |
on: | |
pull_request: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Start A3P container | |
run: docker run -d -p 26657:26657 -p 1317:1317 -p 9090:9090 --name a3p ghcr.io/agoric/agoric-3-proposals:latest | |
- run: corepack enable | |
shell: bash | |
- name: Setup Node.js environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
cache: yarn | |
- name: Install dependencies | |
run: yarn install | |
- name: Start subql indexer | |
run: yarn dev:ci | |
- name: Print initial logs of all containers | |
run: | | |
echo "Fetching initial logs for all containers..." | |
containers=$(docker ps --format '{{.ID}}') | |
for container in $containers; do | |
echo "Fetching initial logs for container $container..." | |
docker logs $container | |
done | |
- name: Wait for 2 minutes | |
run: sleep 120 | |
- name: Print logs after 2 minutes for all containers | |
run: | | |
echo "Fetching logs after 2 minutes for all containers..." | |
containers=$(docker ps --format '{{.ID}}') | |
for container in $containers; do | |
echo "Fetching logs after 2 minutes for container $container..." | |
docker logs $container | |
done | |
- name: Set ATOM Price to 12.34 | |
run: | | |
docker exec a3p /usr/src/agoric-sdk/packages/agoric-cli/bin/agops oracle setPrice --keys gov1,gov2 --pair ATOM.USD --price 12.34 --keyring-backend=test | |
- name: Get active vaults | |
uses: ./.github/actions/getActiveVaults | |
with: | |
apiUrl: 'http://localhost:3000/' | |
expectedVaults: 7 | |
- name: Create Vault with 100 Minted and 15 Collateral | |
uses: ./.github/actions/createVault | |
with: | |
wantMinted: '100' | |
giveCollateral: '15' | |
userKey: 'gov3' | |
agoricNet: 'local' | |
commandTimeout: '120' | |
containerName: 'a3p' | |
- name: Create Vault with 103 Minted and 15 Collateral | |
uses: ./.github/actions/createVault | |
with: | |
wantMinted: '103' | |
giveCollateral: '15' | |
userKey: 'gov3' | |
agoricNet: 'local' | |
commandTimeout: '120' | |
containerName: 'a3p' | |
- name: Create Vault with 105 Minted and 15 Collateral | |
uses: ./.github/actions/createVault | |
with: | |
wantMinted: '105' | |
giveCollateral: '15' | |
userKey: 'gov3' | |
agoricNet: 'local' | |
commandTimeout: '120' | |
containerName: 'a3p' | |
- name: Place bid for 90IST | |
uses: ./.github/actions/placeBid | |
with: | |
fromAddress: 'gov1' | |
giveAmount: '90IST' | |
priceOrDiscount: '9' | |
commandType: 'by-price' | |
agoricNet: 'local' | |
commandTimeout: '120' | |
containerName: 'a3p' | |
- name: Place bid for 80IST | |
uses: ./.github/actions/placeBid | |
with: | |
fromAddress: 'gov1' | |
giveAmount: '80IST' | |
priceOrDiscount: '10' | |
commandType: 'by-discount' | |
agoricNet: 'local' | |
commandTimeout: '120' | |
containerName: 'a3p' | |
- name: Place bid for 150IST | |
uses: ./.github/actions/placeBid | |
with: | |
fromAddress: 'gov1' | |
giveAmount: '150IST' | |
priceOrDiscount: '15' | |
commandType: 'by-discount' | |
agoricNet: 'local' | |
commandTimeout: '120' | |
containerName: 'a3p' | |
- name: Set ATOM Price to 9.99 | |
run: | | |
docker exec a3p /usr/src/agoric-sdk/packages/agoric-cli/bin/agops oracle setPrice --keys gov1,gov2 --pair ATOM.USD --price 9.99 --keyring-backend=test |