Upgrade CI Codecov gh-actions #134
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 | |
- pull_request | |
jobs: | |
test-with-tox: | |
name: Test with tox | |
runs-on: ${{ matrix.platform }} | |
strategy: | |
matrix: | |
# https://help.github.com/articles/virtual-environments-for-github-actions | |
platform: | |
- ubuntu-20.04 | |
- ubuntu-22.04 # ubuntu-latest | |
- macos-11 | |
- macos-12 # macos-latest | |
- macos-13 | |
- windows-2019 | |
- windows-2022 # windows-latest | |
python-version: ['3.7', '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 libsndfile for linux | |
if: matrix.platform == 'ubuntu-18.04' || matrix.platform == 'ubuntu-20.04' || matrix.platform == 'ubuntu-22.04' | |
run: sudo apt-get install -y libsndfile1 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install tox tox-gh-actions | |
- name: Test with tox | |
run: tox | |
- name: Remove tox cache | |
run: rm -r .tox | |
- name: Prepare code coverage data | |
if: matrix.platform == 'ubuntu-22.04' && matrix.python-version == 3.9 | |
run: | | |
pip install pandas tensorflow torch tensorboardX pillow matplotlib soundfile pytest pytest-cov | |
# For NumPy 2.0 compatibility, see: https://github.com/tensorflow/tensorboard/issues/6869 | |
pip install tb-nightly | |
pytest --doctest-glob="*.rst" --cov=./ --cov-report xml --ignore="tests/test_summary_reader/test_no_tensorflow.py" | |
- name: Test documentation | |
if: matrix.platform == 'ubuntu-22.04' && matrix.python-version == 3.9 | |
run: | | |
sudo apt-get install -y pandoc | |
pip install -r requirements.txt | |
# For NumPy 2.0 compatibility, see: https://github.com/tensorflow/tensorboard/issues/6869 | |
pip install tb-nightly | |
sphinx-build -b html docs docs/_build/html | |
sphinx-build -b doctest docs docs/_build/doctest | |
- name: Upload coverage to Codecov | |
if: matrix.platform == 'ubuntu-22.04' && matrix.python-version == 3.9 | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |