ocean-subgraph/.github/workflows/tests.yml

77 lines
2.4 KiB
YAML
Raw Normal View History

name: 'Integration tests'
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
test:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- name: Cache node_modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-test-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-test-integration-${{ env.cache-name }}-
# Env var expansion workaround
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Set ADDRESS_FILE
run: echo "ADDRESS_FILE=${HOME}/.ocean/ocean-contracts/artifacts/address.json" >> $GITHUB_ENV
- name: Checkout Barge
uses: actions/checkout@v2
with:
repository: 'oceanprotocol/barge'
path: 'barge'
ref: main
- name: Login to Docker Hub
if: ${{ env.DOCKERHUB_PASSWORD && env.DOCKERHUB_USERNAME }}
run: |
echo "Login to Docker Hub";echo "$DOCKERHUB_PASSWORD" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
- name: Run Barge
working-directory: ${{ github.workspace }}/barge
run: |
bash -x start_ocean.sh --with-thegraph --skip-subgraph-deploy --no-dashboard 2>&1 > start_ocean.log &
env:
CONTRACTS_VERSION: v1.1.7
- run: npm ci
- name: Wait for contracts deployment
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 10
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break
done
- name: create and deploy subgraph
run: |
npm run quickstart:barge
sleep 20
env:
ADDRESS_FILE: /home/runner/.ocean/ocean-contracts/artifacts/address.json
Implementing first pass of veAllocate schema, handlers, and test cove… (#490) * Implementing first pass of veAllocate schema, handlers, and test coverage. * Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come. * Created documentation. Moving tests away from subgraph and into df-py. * Expanding documentation to be thorough and cover more of the work involved. * use barge artifacts * use proper contracts in ci * use barge artifacts folder * fix replace * use npm contracts dep * use latest contracts for barge * fix some lint * Fix linter errors * Update schema * Finished basic integration of setAllocation event and verified queries/schema is working as intended. * Fixing amount getter. * Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors. * Fixing import. * Use .zero() * Improve readability * Add allocated to schema * Update abi * Update event handlers in the template * Update veREADME * Remove `AllocationRemoved` handler * Hooking data for tx, firstContact, lastUpdate, block * Update event abi * Add chainId and nftAddress to schema * Update `handleAllocationSet` * Update abi * Update readme * Set initial values * Fix math * Missing event param * set initial value of `lastContact` * veOcean template * VeOcean entity * Handler functions - wip * rename file * Delegation schema * veDelegate mapping file * Rename * Update template * Update schema * Update replaces * Add handler for delegation * Update schema * getveDelegation * Update naming * Add deposit entity * Update template * Make delegation an array * Add `handleDelegation` * Add `handleDeposit` for veOCEAN * Add `getveOCEAN` util function * Add `getDeposit` util function * Add `handleBurnBoost` * Add `handleExtendBoost` * Add `handleTransferBoost` * Set default veOCEAN * Remove unused import * Rename Deposit to VeDeposit * Include block number * Remove `allocatedTotal` * Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not.. * bump contracts to v1.1.1 * bump contracts * bump to contracts 1.1.2 * fix script for networks without ve * add veAllocation.sol's AllocationSetMultiple * copy artfacts from barge for npm quickstart:barge * fix using barge artifacts * temp debug * use barge artifacts * use contracts 1.1.3 * use same approach for 'development' * bump ocean-contracts Co-authored-by: alexcos20 <alex.coseru@gmail.com> Co-authored-by: mihaisc <mihai@oceanprotocol.com> Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
BARGE_FOLDER: /home/runner/.ocean/
- run: npm run test-integration
env:
ADDRESS_FILE: /home/runner/.ocean/ocean-contracts/artifacts/address.json
Implementing first pass of veAllocate schema, handlers, and test cove… (#490) * Implementing first pass of veAllocate schema, handlers, and test coverage. * Fixed compiling issues, wrote compiling & testing outline inside of veAllocate.test. More to come. * Created documentation. Moving tests away from subgraph and into df-py. * Expanding documentation to be thorough and cover more of the work involved. * use barge artifacts * use proper contracts in ci * use barge artifacts folder * fix replace * use npm contracts dep * use latest contracts for barge * fix some lint * Fix linter errors * Update schema * Finished basic integration of setAllocation event and verified queries/schema is working as intended. * Fixing amount getter. * Fixed remaining implementation, verified SimpleSubgraph.test is working, and fixed lint errors. * Fixing import. * Use .zero() * Improve readability * Add allocated to schema * Update abi * Update event handlers in the template * Update veREADME * Remove `AllocationRemoved` handler * Hooking data for tx, firstContact, lastUpdate, block * Update event abi * Add chainId and nftAddress to schema * Update `handleAllocationSet` * Update abi * Update readme * Set initial values * Fix math * Missing event param * set initial value of `lastContact` * veOcean template * VeOcean entity * Handler functions - wip * rename file * Delegation schema * veDelegate mapping file * Rename * Update template * Update schema * Update replaces * Add handler for delegation * Update schema * getveDelegation * Update naming * Add deposit entity * Update template * Make delegation an array * Add `handleDelegation` * Add `handleDeposit` for veOCEAN * Add `getveOCEAN` util function * Add `getDeposit` util function * Add `handleBurnBoost` * Add `handleExtendBoost` * Add `handleTransferBoost` * Set default veOCEAN * Remove unused import * Rename Deposit to VeDeposit * Include block number * Remove `allocatedTotal` * Updating schema and fixing errors due to naming changes. Let's keep the user current allocation, maybe we need to create a feature to more easily let them know whether they are fully allocated, or not.. * bump contracts to v1.1.1 * bump contracts * bump to contracts 1.1.2 * fix script for networks without ve * add veAllocation.sol's AllocationSetMultiple * copy artfacts from barge for npm quickstart:barge * fix using barge artifacts * temp debug * use barge artifacts * use contracts 1.1.3 * use same approach for 'development' * bump ocean-contracts Co-authored-by: alexcos20 <alex.coseru@gmail.com> Co-authored-by: mihaisc <mihai@oceanprotocol.com> Co-authored-by: trizin <25263018+trizin@users.noreply.github.com>
2022-09-05 14:07:31 +02:00
BARGE_FOLDER: /home/runner/.ocean/