-
Notifications
You must be signed in to change notification settings - Fork 38
84 lines (81 loc) · 3 KB
/
pytest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
##
## Copyright 2023 Ocean Protocol Foundation
## SPDX-License-Identifier: Apache-2.0
##
name: Provider tests
on:
- push
- pull_request
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Setup Provider
uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: '3.8'
- uses: actions/checkout@v2
name: Checkout Barge
with:
repository: "oceanprotocol/barge"
path: 'barge'
- 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-dashboard 2>&1 --with-rbac --with-provider2 --with-thegraph --with-c2d --skip-subgraph-deploy > start_ocean.log &
- name: Install dependencies
working-directory: ${{ github.workspace }}
run: |
python -m pip install --upgrade pip
pip install -r requirements_dev.txt
- name: Delete default runner images
run: |
docker image rm node:14
docker image rm node:14-alpine
docker image rm node:16
docker image rm node:16-alpine
docker image rm node:18
docker image rm node:18-alpine
docker image rm buildpack-deps:buster
docker image rm buildpack-deps:bullseye
docker image rm debian:10
docker image rm debian:11
docker image rm moby/buildkit:latest
- name: Wait for contracts deployment and C2D cluster to be ready
working-directory: ${{ github.workspace }}/barge
run: |
for i in $(seq 1 250); do
sleep 10
[ -f "$HOME/.ocean/ocean-contracts/artifacts/ready" -a -f "$HOME/.ocean/ocean-c2d/ready" ] && break
done
- name: Verify deployments
run: |
cat $HOME/.ocean/ocean-contracts/artifacts/address.json
- name: Test with pytest
run: |
pytest ocean_provider/validation/test/test_algo_validation.py::test_algo_credentials
- name: docker logs
run: docker logs ocean_aquarius_1 && docker logs ocean_provider_1 && docker logs ocean_provider2_1 && docker logs ocean_ipfs_1
if: ${{ failure() }}
- name: Publish code coverage
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: b0d75c25d5176c59e8ea665bf74396d9ee1bdf2c97f11ccc6869f9e91d80a6c7
dockerbuild:
runs-on: ubuntu-latest
needs: [build]
if: ${{ success() && github.event_name == 'pull_request'}}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build
run: docker build -t "testimage:latest" .