Workflow file for this run
This file contains hidden or 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: Code Coverage and Documentation | |
| on: | |
| push: | |
| pull_request: | |
| types: | |
| - closed | |
| branches: | |
| - main | |
| jobs: | |
| run: | |
| name: Code Coverage and Documentation on ${{ matrix.os }}-${{ matrix.python }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest] | |
| python: ['3.12'] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python }} | |
| - uses: tlylt/install-graphviz@v1 | |
| - name: Install pandoc | |
| run: sudo apt-get install -y pandoc | |
| - name: Install pytorch | |
| run: python -m pip install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cpu | |
| # - name: Install numpy, onnxruntime-training | |
| # run: python -m pip install numpy onnxruntime-training | |
| - name: Install requirements | |
| run: python -m pip install -r requirements.txt | |
| - name: Install requirements dev | |
| run: python -m pip install -r requirements-dev.txt | |
| - name: Cache pip | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.cache/pip | |
| key: ${{ runner.os }}-pip-${{ hashFiles('requirements-dev.txt') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- | |
| ${{ runner.os }}- | |
| - name: pip freeze | |
| run: python -m pip freeze | |
| - name: tiny-llm torch.export.export | |
| run: | | |
| export PYTHONPATH=. | |
| python _unittests/ut_torch_models/test_tiny_llms.py | |
| - name: tiny-llm onnx | |
| run: | | |
| export PYTHONPATH=. | |
| python _unittests/ut_torch_models/test_tiny_llms_onnx.py | |
| continue-on-error: true | |
| - name: tiny-llm example | |
| run: | | |
| export PYTHONPATH=. | |
| python _doc/examples/plot_export_tiny_llm.py | |
| - name: tiny-llm bypass | |
| run: | | |
| export PYTHONPATH=. | |
| python _doc/examples/plot_export_tiny_llm_patched.py | |
| - name: Generate coverage report | |
| run: | | |
| pip install pytest | |
| pip install pytest-cov | |
| export PYTHONPATH=. | |
| UNITTEST_GOING=1 pytest --cov=./onnx_diagnostic/ --cov-report=xml --durations=10 _unittests --ignore _unittests/ut_reference/test_backend_extended_reference_evaluator.py --ignore _unittests/ut_reference/test_backend_onnxruntime_evaluator.py | |
| export PYTHONPATH= | |
| - name: Upload coverage reports to Codecov | |
| uses: codecov/codecov-action@v3 | |
| env: | |
| CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
| - name: Install | |
| run: python -m pip install -e . -v | |
| - name: Copy license, changelogs | |
| run: | | |
| cp LICENSE* ./_doc | |
| cp CHANGELOGS* ./_doc | |
| - name: Documentation | |
| continue-on-error: true | |
| run: UNITTEST_GOING=1 python -m sphinx ./_doc ./dist/html -n -w doc.txt | |
| - name: Summary | |
| run: cat doc.txt | |
| - name: Check for errors and warnings | |
| run: | | |
| if [[ $(grep ERROR doc.txt | grep -v 'l-plot-tiny-llm-export') ]]; then | |
| echo "Documentation produces errors." | |
| grep ERROR doc.txt | grep -v 'l-plot-tiny-llm-export' | |
| exit 1 | |
| fi | |
| if [[ $(grep WARNING doc.txt | grep -v 'l-plot-tiny-llm-export') ]]; then | |
| echo "Documentation produces warnings." | |
| grep WARNING doc.txt | grep -v 'l-plot-tiny-llm-export' | |
| exit 1 | |
| fi | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| path: ./dist/html/** |