2022-06-13 22:04:45 +08:00
|
|
|
# This workflow will install Python dependencies, run tests and lint on several OS with a several versions of Python
|
2022-06-12 21:10:56 +08:00
|
|
|
# See: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
|
2022-06-10 23:29:01 +08:00
|
|
|
|
2024-01-20 03:13:18 +08:00
|
|
|
name: Build on Win-MacOS-Ubuntu with Python 3.8-3.11
|
2022-06-10 23:29:01 +08:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [ "main" ]
|
2022-07-08 23:34:17 +08:00
|
|
|
paths-ignore:
|
2023-11-16 20:06:50 +08:00
|
|
|
- 'setup.cfg'
|
2022-07-08 23:34:17 +08:00
|
|
|
- 'README.md'
|
|
|
|
- 'Content/**'
|
2022-06-10 23:29:01 +08:00
|
|
|
pull_request:
|
|
|
|
branches: [ "main" ]
|
|
|
|
|
2022-06-12 21:10:56 +08:00
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
2022-06-10 23:29:01 +08:00
|
|
|
jobs:
|
|
|
|
build:
|
2022-06-12 21:10:56 +08:00
|
|
|
runs-on: ${{ matrix.os }}
|
2022-06-10 23:29:01 +08:00
|
|
|
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
2023-05-04 22:35:55 +08:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2024-01-20 03:13:18 +08:00
|
|
|
python-version: [3.8, 3.9, "3.10", "3.11"]
|
2022-06-12 21:10:56 +08:00
|
|
|
include:
|
2022-06-13 21:22:48 +08:00
|
|
|
- os: ubuntu-latest
|
|
|
|
path: ~/.cache/pip
|
2023-05-04 22:35:55 +08:00
|
|
|
- os: macos-latest
|
2022-06-13 20:37:31 +08:00
|
|
|
path: ~/Library/Caches/pip
|
2022-06-12 21:10:56 +08:00
|
|
|
- os: windows-latest
|
|
|
|
path: ~\AppData\Local\pip\Cache
|
2022-06-10 23:29:01 +08:00
|
|
|
|
|
|
|
steps:
|
2022-06-12 21:10:56 +08:00
|
|
|
- name: Checkout code
|
2024-01-27 06:43:29 +08:00
|
|
|
uses: actions/checkout@v4
|
2022-06-12 21:10:56 +08:00
|
|
|
|
|
|
|
- name: Set up Python ${{ matrix.python-version }}
|
2024-01-27 06:52:33 +08:00
|
|
|
uses: actions/setup-python@v5
|
2022-06-12 21:10:56 +08:00
|
|
|
with:
|
|
|
|
python-version: ${{ matrix.python-version }}
|
|
|
|
|
|
|
|
- name: Install dependencies
|
|
|
|
run: |
|
|
|
|
python -m pip install --upgrade pip
|
|
|
|
python -m pip install flake8 pytest
|
2022-06-13 16:49:18 +08:00
|
|
|
python -m pip install git+https://github.com/${{ github.repository }}.git@${{ github.sha }}
|
2022-06-12 21:10:56 +08:00
|
|
|
- name: Lint with flake8
|
|
|
|
run: |
|
|
|
|
# stop the build if there are Python syntax errors or undefined names
|
|
|
|
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
|
|
|
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
|
|
|
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
|
|
|
- name: Test with pytest
|
|
|
|
run: |
|
2024-04-15 21:39:32 +08:00
|
|
|
cd Pose2Sim/S00_Demo_BatchSession
|
2024-04-15 17:02:22 +08:00
|
|
|
pytest -v tests.py
|