2021-04-13 17:10:03 +02:00
|
|
|
name: 'Integration tests'
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- '**'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
test:
|
|
|
|
runs-on: ubuntu-latest
|
2022-05-12 19:31:12 +02:00
|
|
|
strategy:
|
2021-08-03 14:16:02 +02:00
|
|
|
max-parallel: 1
|
2021-04-13 17:10:03 +02:00
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
2022-02-14 09:35:55 +01:00
|
|
|
- uses: actions/setup-node@v2
|
2021-04-13 17:10:03 +02:00
|
|
|
with:
|
2021-08-03 14:16:02 +02:00
|
|
|
node-version: '16'
|
2022-02-14 09:35:55 +01:00
|
|
|
- name: Cache node_modules
|
2021-08-03 14:16:02 +02:00
|
|
|
uses: actions/cache@v2
|
|
|
|
env:
|
|
|
|
cache-name: cache-node-modules
|
2021-04-13 17:10:03 +02:00
|
|
|
with:
|
|
|
|
path: ~/.npm
|
2022-02-14 09:35:55 +01:00
|
|
|
key: ${{ runner.os }}-test-integration-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
restore-keys: ${{ runner.os }}-test-integration-${{ env.cache-name }}-
|
2021-08-03 14:16:02 +02:00
|
|
|
|
2022-02-14 09:35:55 +01:00
|
|
|
# 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
|
2021-04-13 17:10:03 +02:00
|
|
|
with:
|
2021-08-03 14:16:02 +02:00
|
|
|
repository: 'oceanprotocol/barge'
|
2021-04-13 17:10:03 +02:00
|
|
|
path: 'barge'
|
2022-06-20 15:46:54 +02:00
|
|
|
ref: main
|
2022-02-14 09:35:55 +01:00
|
|
|
|
|
|
|
- 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 }}
|
|
|
|
|
2021-04-13 17:10:03 +02:00
|
|
|
- name: Run Barge
|
|
|
|
working-directory: ${{ github.workspace }}/barge
|
|
|
|
run: |
|
2022-02-14 09:35:55 +01:00
|
|
|
bash -x start_ocean.sh --with-thegraph --skip-subgraph-deploy --no-dashboard 2>&1 > start_ocean.log &
|
2022-03-14 13:40:05 +01:00
|
|
|
env:
|
2022-04-04 14:52:30 +02:00
|
|
|
CONTRACTS_VERSION: v1.0.0-alpha.28
|
2022-05-12 19:31:12 +02:00
|
|
|
|
2022-02-14 09:35:55 +01:00
|
|
|
- run: npm ci
|
|
|
|
|
|
|
|
- name: Wait for contracts deployment
|
|
|
|
working-directory: ${{ github.workspace }}/barge
|
|
|
|
run: |
|
|
|
|
for i in $(seq 1 250); do
|
|
|
|
sleep 10
|
2021-04-13 17:10:03 +02:00
|
|
|
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" ] && break
|
|
|
|
done
|
2021-08-03 14:16:02 +02:00
|
|
|
- name: create and deploy subgraph
|
|
|
|
run: |
|
2022-02-17 11:59:55 +01:00
|
|
|
npm run quickstart:barge
|
2021-08-03 14:16:02 +02:00
|
|
|
sleep 20
|
|
|
|
env:
|
|
|
|
ADDRESS_FILE: /home/runner/.ocean/ocean-contracts/artifacts/address.json
|
2021-04-13 17:10:03 +02:00
|
|
|
- run: npm run test-integration
|
|
|
|
env:
|
|
|
|
ADDRESS_FILE: /home/runner/.ocean/ocean-contracts/artifacts/address.json
|