Skip to content

Commit

Permalink
test: enable tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
Adamantios committed Jun 5, 2024
1 parent 5bbd184 commit 20af8c0
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 4 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/common_checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,100 @@ jobs:
tar -xzf gitleaks_8.10.1_linux_x64.tar.gz && \
sudo install gitleaks /usr/bin && \
gitleaks detect --report-format json --report-path leak_report -v
test:
continue-on-error: True
needs:
- lock_check
- copyright_and_dependencies_check
- linter_checks
runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
python-version: [ "3.8", "3.9", "3.10", "3.11" ]

timeout-minutes: 30

steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: actions/setup-go@v3
with:
go-version: "1.17.7"
- if: matrix.os == 'ubuntu-latest'
name: Install dependencies (ubuntu-latest)
run: |
sudo apt-get update --fix-missing
sudo apt-get autoremove
sudo apt-get autoclean
pip install tomte[tox]==0.2.14
pip install --user --upgrade setuptools
# install Protobuf compiler
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip
unzip protoc-24.3-linux-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
# install Tendermint
wget -O tendermint.tar.gz https://github.com/tendermint/tendermint/releases/download/v0.34.19/tendermint_0.34.19_linux_amd64.tar.gz
tar -xf tendermint.tar.gz
sudo mv tendermint /usr/local/bin/tendermint
- if: matrix.os == 'ubuntu-latest'
name: Packages unit tests ubuntu-latest
run: |
tox -e py${{ matrix.python-version }}-linux
- if: matrix.os == 'macos-latest'
name: Install dependencies (macos-latest)
run: |
pip install tomte[tox]==0.2.14
brew install gcc
# brew install protobuf
# brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/72457f0166d5619a83f508f2345b22d0617b5021/Formula/protobuf.rb
wget https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-osx-x86_64.zip
unzip protoc-24.3-osx-x86_64.zip -d protoc
sudo mv protoc/bin/protoc /usr/local/bin/protoc
brew tap yoheimuta/protolint
brew install protolint
- if: matrix.os == 'macos-latest'
name: Packages unit tests macos-latest
run: |
tox -e py${{ matrix.python-version }}-darwin
- if: matrix.os == 'windows-latest'
name: Install dependencies (windows-latest)
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
run: |
python -m pip install -U pip
echo "::add-path::C:\Program Files (x86)\Windows Kits\10\bin\10.0.18362.0\x64"
choco install wget -y
choco install protoc --version 24.3
choco install mingw -y
choco install make -y
# to check make was installed
make --version
pip install tomte[tox]==0.2.14
- if: matrix.os == 'windows-latest'
name: Packages unit tests windows-latest
run: |
tox -e py${{ matrix.python-version }}-win
- if: matrix.os == 'ubuntu-latest'
name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
103 changes: 99 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,27 @@ deps =
openapi-core==0.15.0
openapi-spec-validator<0.5.0,>=0.4.0

[extra-deps]
[deps-base]
deps ={[deps-packages]deps}

[testenv-multi-ubuntu]
deps = {[deps-base]deps}

[testenv-multi-win]
deps =
pyyaml<=6.0.1,>=3.10
; end-extra
{[deps-base]deps}
pywin32==304
websocket-client==0.59.0
certifi==2021.10.8
idna==3.3

[testenv-multi-darwin]
deps = {[deps-base]deps}

[testenv]
basepython = python3
whitelist_externals = /bin/sh
deps = {[deps-packages]deps}
deps = {[deps-base]deps}
passenv = *
extras = all
setenv =
Expand All @@ -72,6 +84,89 @@ setenv =
PACKAGES_PATHS = packages/valory
SKILLS_PATHS = {env:PACKAGES_PATHS}/skills
SERVICE_SPECIFIC_PACKAGES = {env:SKILLS_PATHS}/staking_abci {env:SKILLS_PATHS}/market_manager_abci {env:SKILLS_PATHS}/decision_maker_abci {env:SKILLS_PATHS}/trader_abci {env:SKILLS_PATHS}/tx_settlement_multiplexer_abci {env:SKILLS_PATHS}/check_stop_trading_abci
CONTRACTS_PATHS = {env:PACKAGES_PATHS}/contracts

[commands-base]
commands =
autonomy init --reset --author ci --remote --ipfs --ipfs-node "/dns/registry.autonolas.tech/tcp/443/https"
autonomy packages sync

[commands-packages]
commands =
{[commands-base]commands}
pytest -rfE {env:SKILLS_PATHS}/decision_maker_abci/tests --cov={env:SKILLS_PATHS}/decision_maker_abci --cov-report=xml --cov-report=term --cov-report=term-missing --cov-config=.coveragerc {posargs}

[testenv:py3.8-linux]
basepython = python3.8
platform=^linux$
deps = {[testenv-multi-ubuntu]deps}
commands = {[commands-packages]commands}

[testenv:py3.9-linux]
basepython = python3.9
platform=^linux$
deps = {[testenv-multi-ubuntu]deps}
commands = {[commands-packages]commands}

[testenv:py3.10-linux]
basepython = python3.10
platform=^linux$
deps = {[testenv-multi-ubuntu]deps}
commands = {[commands-packages]commands}

[testenv:py3.11-linux]
basepython = python3.11
platform=^linux$
deps = {[testenv-multi-ubuntu]deps}
commands = {[commands-packages]commands}

[testenv:py3.8-win]
basepython = python3.8
platform=^win32$
deps = {[testenv-multi-win]deps}
commands = {[commands-packages]commands}

[testenv:py3.9-win]
basepython = python3.9
platform=^win32$
deps = {[testenv-multi-win]deps}
commands = {[commands-packages]commands}

[testenv:py3.10-win]
basepython = python3.10
platform=^win32$
deps = {[testenv-multi-win]deps}
commands = {[commands-packages]commands}

[testenv:py3.11-win]
basepython = python3.11
platform=^win32$
deps = {[testenv-multi-win]deps}
commands = {[commands-packages]commands}

[testenv:py3.8-darwin]
basepython = python3.8
platform=^darwin$
deps = {[testenv-multi-darwin]deps}
commands = {[commands-packages]commands}

[testenv:py3.9-darwin]
basepython = python3.9
platform=^darwin$
deps = {[testenv-multi-darwin]deps}
commands = {[commands-packages]commands}

[testenv:py3.10-darwin]
basepython = python3.10
platform=^darwin$
deps = {[testenv-multi-darwin]deps}
commands = {[commands-packages]commands}

[testenv:py3.11-darwin]
basepython = python3.11
platform=^darwin$
deps = {[testenv-multi-darwin]deps}
commands = {[commands-packages]commands}

[testenv:bandit]
skipsdist = True
Expand Down

0 comments on commit 20af8c0

Please sign in to comment.