pose2sim/.github/workflows/python-package.yml

55 lines
1.7 KiB
YAML
Raw Normal View History

2022-06-12 21:10:56 +08:00
# This workflow will install Python dependencies, run tests and lint with a several versions of Python
# See: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
2022-06-10 23:29:01 +08:00
2022-06-13 21:19:55 +08:00
name: Continuous Integration
2022-06-10 23:29:01 +08:00
on:
push:
branches: [ "main" ]
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:
2022-06-13 20:37:31 +08:00
os: [ubuntu-latest, macos-11, windows-latest]
2022-06-13 20:53:09 +08:00
python-version: [3.7, 3.8, 3.9, "3.10"]
2022-06-12 21:10:56 +08:00
include:
- os: ubuntu-latest path: ~/.cache/pip
2022-06-13 20:37:31 +08:00
- os: macos-11
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
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
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: |
2022-06-13 20:25:34 +08:00
cd Pose2Sim/Demo
2022-06-13 20:32:52 +08:00
pytest -v test.py