Merge pull request #721 from DumbMice/master #172
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Python application | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
sudo apt install libsndfile1 | |
python -m pip install --upgrade pip | |
pip install flake8 pytest | |
if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 tensorboardX --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 tensorboardX --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Test with pytest | |
env: | |
MPLBACKEND: Agg | |
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION: python | |
run: | | |
visdom & | |
pytest --cov=tensorboardX tests/ | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
test: | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.9 | |
- name: Run examples | |
run: | | |
pip install six tensorboard pytest matplotlib torchvision protobuf==4.22.3 moviepy==1.0.3 imageio==2.27 | |
python examples/demo.py | |
python examples/demo_graph.py | |
python examples/demo_embedding.py | |
python examples/demo_custom_scalars.py | |
python examples/demo_multiple_embedding.py | |
python examples/demo_purge.py | |
python examples/demo_matplotlib.py | |
test-protobuf-versions: | |
needs: build | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
protobuf-version: ["3.20", "4.21", "4.22", "4.23"] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python 3.11 | |
uses: actions/setup-python@v2 | |
with: | |
python-version: 3.11 | |
- name: Run examples | |
run: | | |
pip install numpy protobuf==${{ matrix.protobuf-version }} | |
python -c "import tensorboardX" | |