-
Notifications
You must be signed in to change notification settings - Fork 7
74 lines (71 loc) · 2.45 KB
/
python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# 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 utils.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 utils.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