Skip to content

[Fix] Error when tracking static method #87

[Fix] Error when tracking static method

[Fix] Error when tracking static method #87

Workflow file for this run

# This workflow will setup GitHub-hosted runners
name: tests
# Define the events that trigger the workflow
on:
# Run on pull requests to main branch
pull_request:
branches: [main]
types: [synchronize, opened, reopened, ready_for_review]
# Run on pushes to main branch
push:
branches: [main]
jobs:
# Run unit tests in all relevant versions
tests_with_pip:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# OS [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
# Relevant Python versions
python-version: ["3.8", "3.9", "3.10", "3.11"]
# Do not cancel all in-progress jobs if any matrix job fails
fail-fast: false
steps:
# Used to reset cache every month
- name: Get current year-month
id: date
run: echo "::set-output name=date::$(date +'%Y-%m')"
- uses: actions/checkout@v2
- name: Cache test_env
uses: actions/cache@v2
with:
path: ~/test_env
# Look to see if there is a cache hit for the corresponding
# requirements files. The cache will be reset on changes to
# any requirements or every month
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}
-${{ hashFiles('**/requirements-tests.txt') }}-${{ hashFiles('setup.py') }}
-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
# Install required Python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
# Create an environment and install everything
# Add coveralls later pip install pytest-cov coveralls
- name: Install dependencies
run: |
python -m venv ~/test_env
source ~/test_env/bin/activate
python -m pip install --upgrade pip
pip install -r requirements/requirements-tests.txt
pip install -r requirements/requirements.txt
pip install -e .
# Output the Python version and environment information
- name: List packages
run: |
source ~/test_env/bin/activate
pip list
python --version
# Run unit tests with Pytest
- name: Test with pytest
run: |
source ~/test_env/bin/activate
pytest
docs:
name: docs (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
matrix:
# OS [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest]
steps:
# Used to reset cache every month
- name: Get current year-month
id: date
run: echo "::set-output name=date::$(date +'%Y-%m')"
- uses: actions/checkout@v2
- name: Cache doc_env
uses: actions/cache@v2
with:
path: ~/doc_env
# Look to see if there is a cache hit for the corresponding
# requirements files. The cache will be reset on changes to
# any requirements or every month
key: ${{ runner.os }}-venv-${{ hashFiles('**/requirements.txt') }}
-${{ hashFiles('**/requirements-docs.txt') }}-${{ hashFiles('setup.py') }}
-${{ hashFiles('**/CI.yml') }}-${{ steps.date.outputs.date }}
# Install required Python version
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: "3.9"
# Create an environment and install everything
- name: Install dependencies
run: |
python -m venv ~/doc_env
source ~/doc_env/bin/activate
python -m pip install --upgrade pip
pip install -r requirements/requirements-docs.txt
pip install -r requirements/requirements.txt
pip install -e .
- name: List packages
run: |
source ~/doc_env/bin/activate
pip list
python --version
- name: make html
run: |
source ~/doc_env/bin/activate
cd doc
make html