-
Notifications
You must be signed in to change notification settings - Fork 158
72 lines (61 loc) · 2.85 KB
/
python_sdk_test.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
# python_sdk_test.yml/Open GoPro, Version 2.0 (C) Copyright 2021 GoPro, Inc. (http://gopro.com/OpenGoPro).
# This copyright was auto-generated on Wed, Sep 1, 2021 5:05:35 PM
# It only runs when something inside sdk_wireless_camera_control has changed
name: Python SDK Unit Testing
on:
pull_request:
branches: [main]
paths:
- 'demos/python/sdk_wireless_camera_control/**'
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-12, ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-12
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
steps:
- name: Checkout source branch
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Check for cached pip environment
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('demos/python/sdk_wireless_camera_control/poetry.lock') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install prereqs on Ubuntu
run: sudo apt-get update && sudo apt install -y bluez graphviz
if: ${{ matrix.os == 'ubuntu-latest'}}
- name: Install dependencies
working-directory: ./demos/python/sdk_wireless_camera_control/
run: |
python -m pip install --upgrade pip wheel
pip install nox==2023.4.22
pip install nox-poetry==1.0.3
pip install poetry
- name: Unit Testing for all cases
working-directory: ./demos/python/sdk_wireless_camera_control/
run: nox -p ${{ matrix.python-version }} -s tests
# Only test docs with latest Python on ubuntu since we need graphviz
- name: Full linting only on ubuntu with latest python
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.11'
working-directory: ./demos/python/sdk_wireless_camera_control/
run: nox -p 3.11 -s format lint docstrings docs
- name: Archive test report on failure
uses: actions/upload-artifact@v4
if: failure()
with:
name: test-reports
path: ./demos/python/sdk_wireless_camera_control/.reports
retention-days: 2