tests #133
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 | |
tags: ['v[0-9]*', '[0-9]+.[0-9]+*'] | |
pull_request: | |
branches: | |
- main | |
schedule: | |
- cron: '0 13 * * 3' | |
jobs: | |
precommit-hooks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- uses: pre-commit/action@v3.0.0 | |
unit-tests-no-soft-deps: | |
needs: precommit-hooks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Python setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[dev]" | |
- name: Run unit tests | |
run: | | |
pytest --ignore=tests/test_orbit_model_export.py | |
unit-tests-soft-deps: | |
needs: unit-tests-no-soft-deps | |
strategy: | |
matrix: | |
python-version: ['3.8', '3.9'] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Python setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[dev,orbit]" | |
- name: Run unit tests | |
run: | | |
python -m pytest | |
- name: Publish code coverage | |
if: matrix.python-version == '3.9' | |
uses: codecov/codecov-action@v3 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
examples: | |
needs: [unit-tests-no-soft-deps, unit-tests-soft-deps] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install datasetsforecast==0.0.8 | |
pip install -e ".[orbit]" | |
- name: Run examples | |
run: | | |
./build_tools/run_examples.sh | |
documentation: | |
needs: examples | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -e ".[dev]" | |
- name: Build documentation | |
run: | | |
echo "Building documentation" | |
cd docs | |
make clean | |
make html | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: sphinx | |
path: docs/build/html |