build #775
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 variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: build | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
paths: | |
'**.py' | |
schedule: | |
- cron: '0 10 * * *' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
python-version: ['3.10', '3.11', '3.12'] | |
os: [macos-latest, macos-14, windows-latest] | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 30 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies on macOS and Linux | |
if: matrix.os != 'windows-latest' | |
run: | | |
python -m pip install --upgrade pip | |
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
python -m scripts.ns_download_models | |
export SHELL=bash | |
shell: bash | |
- name: Install missing libs on Ubuntu | |
if: matrix.os == 'ubuntu-latest' | |
run: | | |
sudo apt-get install --reinstall libegl1 libxcb-cursor0 | |
shell: bash | |
- name: Install dependencies on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m pip install --upgrade pip | |
if (Test-Path -Path '.\requirements-dev.txt' -PathType Leaf) {pip install --upgrade -r requirements-dev.txt} | |
if (Test-Path -Path '.\requirements.txt' -PathType Leaf) {pip install --upgrade -r requirements.txt} | |
python -m scripts.ns_download_models | |
shell: pwsh | |
- name: Build dist and test with unittest on macOS and Linux | |
if: matrix.os != 'windows-latest' | |
run: | | |
python -m build | |
pip install dist/*.whl | |
python -m unittest | |
shell: bash | |
- name: Build dist and test with unittest on Windows | |
if: matrix.os == 'windows-latest' | |
run: | | |
python -m build | |
pip install (Get-ChildItem dist/*.whl) | |
python -m unittest | |
shell: pwsh | |
- name: Generate coverage report | |
run: | | |
coverage run --source neosca --parallel-mode -m unittest | |
coverage combine | |
coverage xml -i | |
- name: Upload report to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
file: ./coverage.xml |