Fix non-deterministic dynapcnn-network test #982
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: CI | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: psf/black@stable | |
multitest: | |
needs: lint | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest] | |
python-version: ["3.8", "3.10",] | |
torch-version: ["1.12.0",] | |
exclude: | |
- os: ubuntu-latest | |
python-version: "3.10" | |
torch-version: "1.8.1" | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install requirements | |
run: | | |
sudo apt-get update && sudo apt-get -y install libglu1-mesa | |
pip install torch~=${{ matrix.torch-version }} torchvision --index-url https://download.pytorch.org/whl/cpu | |
pip install . | |
pip install -r tests/requirements.txt | |
- name: Test with pytest | |
run: | | |
pytest tests | |
env: | |
CI: true | |
coverage: | |
needs: multitest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Generate coverage report | |
run: | | |
sudo apt-get update && sudo apt-get -y install libglu1-mesa | |
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
pip install -r tests/requirements.txt | |
pip install . | |
coverage run -m pytest tests | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
documentation: | |
needs: multitest | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
sudo apt-get update && sudo apt-get -y install libglu1-mesa | |
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu | |
pip install . | |
pip install -r docs/requirements.txt | |
- name: Build documentation | |
run: | | |
cd docs && make clean && make html # Use SPHINXOPTS="-W" to fail on warning. | |
build-and-publish: | |
needs: documentation | |
runs-on: ubuntu-latest | |
if: ${{ github.ref == 'refs/heads/develop' || startsWith(github.ref, 'refs/tags/') }} | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.8 | |
- name: Install build packages | |
run: pip install wheel pbr setuptools | |
- name: Build a binary wheel and a source tarball | |
run: python setup.py sdist bdist_wheel | |
- name: Publish distribution package to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
password: ${{ secrets.PYPI_DEPLOYMENT }} | |
skip_existing: true | |
- name: Github release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') |