2022-10-30 17:52:21 +00:00
|
|
|
name: '🔎 Python Tests'
|
|
|
|
|
2022-11-10 01:21:58 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
types: [opened, reopened, edited, ready_for_review, synchronize]
|
2022-10-30 17:52:21 +00:00
|
|
|
|
|
|
|
concurrency:
|
2022-11-10 01:33:51 +00:00
|
|
|
group: ci-tests-${{ github.ref }}-pytest
|
2022-10-30 17:52:21 +00:00
|
|
|
cancel-in-progress: true
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
jobs:
|
2022-11-01 15:29:29 +00:00
|
|
|
python-tests:
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2022-11-14 23:05:57 +00:00
|
|
|
python-version: [ "3.7", "3.10" ]
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
pip install .[dev]
|
|
|
|
|
2022-10-30 16:59:27 +00:00
|
|
|
- name: Install Solidity Compiler
|
|
|
|
run: python ./scripts/installation/install_solc.py
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Check Python Entrypoint
|
|
|
|
run: python -c "import nucypher; print(nucypher.__version__)"
|
|
|
|
|
|
|
|
- name: Unit Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:unit-coverage.xml tests/unit
|
|
|
|
|
|
|
|
- name: Upload unit tests coverage to Codecov
|
|
|
|
if: matrix.python-version == '3.10'
|
|
|
|
uses: codecov/codecov-action@v3.1.1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
files: unit-coverage.xml
|
|
|
|
flags: unit
|
|
|
|
verbose: true
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Integration Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:integration-coverage.xml tests/integration
|
|
|
|
|
|
|
|
- name: Upload integration tests coverage to Codecov
|
|
|
|
if: matrix.python-version == '3.10'
|
|
|
|
uses: codecov/codecov-action@v3.1.1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
files: integration-coverage.xml
|
|
|
|
flags: integration
|
|
|
|
verbose: true
|
2022-10-30 16:56:49 +00:00
|
|
|
|
2022-11-14 16:04:13 +00:00
|
|
|
# Acceptance tests
|
2022-10-30 16:56:49 +00:00
|
|
|
- name: Agents Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-blockchain-agents-coverage.xml tests/acceptance/blockchain/agents
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Actors Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-blockchain-actors-coverage.xml tests/acceptance/blockchain/actors
|
2022-10-30 16:56:49 +00:00
|
|
|
|
2022-10-30 17:52:21 +00:00
|
|
|
- name: Deployers Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-blockchain-deployers-coverage.xml tests/acceptance/blockchain/deployers
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Interfaces Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-blockchain-interfaces-coverage.xml tests/acceptance/blockchain/interfaces
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Conditions Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-blockchain-conditions-coverage.xml tests/acceptance/blockchain/conditions
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Characters Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-characters-coverage.xml tests/acceptance/characters
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Node Discovery Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-learning-coverage.xml tests/acceptance/learning
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Network Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-network-coverage.xml tests/acceptance/network
|
2022-10-30 16:56:49 +00:00
|
|
|
|
|
|
|
- name: Utility Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-utilities-coverage.xml tests/acceptance/utilities
|
2022-10-30 17:52:21 +00:00
|
|
|
|
|
|
|
- name: Check CLI Entrypoint
|
|
|
|
run: nucypher --help
|
|
|
|
|
|
|
|
- name: CLI Tests
|
2022-11-14 16:04:13 +00:00
|
|
|
run: python -m pytest --cov-report=xml:acceptance-cli-coverage.xml tests/acceptance/cli
|
2022-11-11 19:57:53 +00:00
|
|
|
|
2022-11-14 16:04:13 +00:00
|
|
|
- name: Upload acceptance tests coverage to Codecov
|
2022-11-11 19:57:53 +00:00
|
|
|
if: matrix.python-version == '3.10'
|
2022-11-14 16:04:13 +00:00
|
|
|
uses: codecov/codecov-action@v3.1.1
|
|
|
|
with:
|
|
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
|
|
files: acceptance-blockchain-agents-coverage.xml, acceptance-blockchain-actors-coverage.xml, acceptance-blockchain-deployers-coverage.xml, acceptance-blockchain-interfaces-coverage.xml, acceptance-blockchain-conditions-coverage.xml, acceptance-characters-coverage.xml, acceptance-learning-coverage.xml, acceptance-network-coverage.xml, acceptance-utilities-coverage.xml, acceptance-cli-coverage.xml
|
|
|
|
flags: acceptance
|
|
|
|
verbose: true
|