Skip to content

Commit

Permalink
Fix #548: Improve tests speed (#558)
Browse files Browse the repository at this point in the history
* Improve tests speed
  • Loading branch information
alexcos20 authored May 9, 2023
1 parent 96b8aa6 commit 11b6c2f
Showing 1 changed file with 40 additions and 12 deletions.
52 changes: 40 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ jobs:
repository: "oceanprotocol/barge"
path: "barge"
ref: 9cc3a9342a47857a0495309e787462d6c60979e6

- 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 --no-aquarius --no-elasticsearch --no-provider --no-dashboard --with-thegraph > start_ocean.log &
for i in $(seq 1 108); do
sleep 5
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break
done
ls -la "$HOME/.ocean/ocean-contracts/artifacts/"
bash -x start_ocean.sh --no-aquarius --no-elasticsearch --no-provider --no-dashboard --with-thegraph > start_ocean.log &
env:
CONTRACTS_VERSION: v1.1.3
SUBGRAPH_VERSION: v3.0.7
Expand All @@ -50,21 +51,48 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Create Brownie paths
run: |
mkdir /home/runner/.solcx
mkdir /home/runner/.vvm
mkdir -p /home/runner/.brownie/packages
- name: Restore Brownie compilers
id: restore-brownie-compilers
uses: actions/cache/restore@v3
with:
path: |
/home/runner/.solcx
/home/runner/.vvm
/home/runner/.brownie/packages
key: ${{ runner.os }}-brownie-deps
- name: Set up Openzeppelin
run: |
brownie pm install OpenZeppelin/openzeppelin-contracts@4.2.0
brownie pm install GNSPS/solidity-bytes-utils@0.8.0
[ -d "$HOME/.brownie/packages/OpenZeppelin/openzeppelin-contracts@4.2.0" ] && echo "Using OpenZeppelin/openzeppelin-contracts@4.2.0 from cache" || brownie pm install OpenZeppelin/openzeppelin-contracts@4.2.0
[ -d "$HOME/.brownie/packages/GNSPS/solidity-bytes-utils@0.8.0" ] && echo "Using GNSPS/solidity-bytes-utils@0.8.0/ from cache" || brownie pm install GNSPS/solidity-bytes-utils@0.8.0
- name: Make dftool executable
run: chmod +x dftool

- 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: Test with Brownie
run: |
coverage run --omit="*test*" -m pytest util/test
coverage report
coverage xml
- name: Save Brownie compilers
id: cache-brownie-compilers
uses: actions/cache/save@v3
with:
path: |
/home/runner/.solcx
/home/runner/.vvm
/home/runner/.brownie/packages
key: ${{ runner.os }}-brownie-deps
- name: Publish code coverage
uses: paambaati/codeclimate-action@v2.7.5
env:
Expand Down

0 comments on commit 11b6c2f

Please sign in to comment.