Skip to content

rewrite example with our sdk and add extra env #98

rewrite example with our sdk and add extra env

rewrite example with our sdk and add extra env #98

name: Run tests againts dev version on PR
on:
pull_request:
jobs:
local-test:
runs-on: ubuntu-latest
environment: test # The below environment variables are only available in the test environment
env:
TEST_PRIVATE_KEY: ${{ secrets.TEST_PRIVATE_KEY }}
TOKEN_CONTRACT: ${{ vars.TOKEN_CONTRACT }}
ORACLE_CONTRACT: ${{ vars.ORACLE_CONTRACT }}
CHAIN_ENDPOINT: ${{ secrets.CHAIN_ENDPOINT }}
ENDPOINT: "localhost:2206"
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Bring up docker compose
run: |
docker compose up -d
- name: Debug environment variables
run: |
echo "TOKEN_CONTRACT: $TOKEN_CONTRACT"
echo "ORACLE_CONTRACT: $ORACLE_CONTRACT"
echo "ENDPOINT: $ENDPOINT"
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"
cache: "yarn"
- name: Install dependencies
run: yarn install
- name: ensure the aggregator and env is ready
run: |
until curl --output /dev/null --silent --fail http://localhost:1323/up; do
printf '.'
sleep 5
done
- name: Build
run: yarn build
- name: Setup test environment
id: setup-env
run: |
echo "TEST_API_KEY=$(docker compose exec aggregator /ava create-api-key --role=admin --subject=apikey)" >> $GITHUB_ENV
echo "ENDPOINT=localhost:2206" >> $GITHUB_ENV
- name: Test Authentication
run: yarn test:auth
- name: Test Create Workflow
run: yarn test:createWorkflow
- name: Test Get Workflow
run: yarn test:getWorkflow
- name: Test Get Workflows
run: yarn test:getWorkflows
- name: Test Cancel Workflow
run: yarn test:cancelWorkflow
- name: Test Delete Workflow
run: yarn test:deleteWorkflow
- name: Test Get Executions
run: yarn test:getExecutions
- name: Test Get Wallet
run: yarn test:getWallet
- name: Test Get Wallets
run: yarn test:getWallets
- name: Test Secret
run: yarn test:secret