update workflows #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, "3.10", "3.11"] | |
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 system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y g++ python3-dev | |
- name: Install build dependencies | |
run: | | |
python -m pip install --upgrade pip setuptools wheel | |
python -m pip install build | |
python -m pip install numpy>=1.19.0 pandas>=1.0.0 | |
python -m pip install pytest>=6.0.0 pytest-cov>=2.0.0 | |
- name: Build and install package | |
run: | | |
# Build the package | |
python -m build --wheel | |
# Install the built wheel | |
pip install dist/*.whl | |
- name: Verify installation | |
run: | | |
python -c "import pattern_causality; print(pattern_causality.__file__)" | |
python -c "import pattern_causality.utils.statespace" | |
- name: Run tests | |
run: | | |
python -m pytest tests/ -v --cov=pattern_causality --cov-report=xml | |
- name: Upload coverage | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: false |