✨ Add support for regression & BNNs #357
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 | |
- dev | |
pull_request_target: | |
schedule: | |
- cron: "42 7 * * 0" | |
workflow_dispatch: | |
env: | |
POETRY_VERSION: "1.3.2" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.10"] | |
env: | |
PYTHON_VERSION: ${{ matrix.python-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# Update full Python version | |
- name: Full Python version | |
run: | | |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" | |
echo "PYTHON_VERSION=$(python -c "import platform; print(platform.python_version())")" >> $GITHUB_ENV | |
- name: Cache Packages | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.local | |
.venv | |
key: poetry-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | |
- name: Install and configure Poetry | |
uses: snok/install-poetry@v1.3.3 | |
with: | |
version: ${{ env.POETRY_VERSION }} | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Cache folder for Torch Uncertainty | |
uses: actions/cache@v3 | |
id: cache-folder | |
with: | |
path: | | |
~/.cache/torch-uncertainty/ | |
key: torch-uncertainty-${{ runner.os }} | |
- name: Install dependencies | |
run: | | |
pip install torch==1.13 --extra-index-url https://download.pytorch.org/whl/cpu && poetry install --with "dev docs" | |
- name: Style checking | |
run: | | |
poetry run flake8 torch_uncertainty tests | |
poetry run isort --check-only torch_uncertainty tests | |
poetry run black --check torch_uncertainty tests | |
- name: Test with pytest and compute coverage | |
run: | | |
poetry run pytest --cov --cov-report xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
if: ${{ github.event_name != 'pull_request_target' }} | |
continue-on-error: true | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.xml | |
flags: cpu,pytest | |
name: CPU-coverage | |
env_vars: PYTHON_VERSION | |
- name: Test sphinx build without tutorials | |
run: | | |
cd docs && poetry run make html-noplot |