-
Notifications
You must be signed in to change notification settings - Fork 152
71 lines (60 loc) · 2.73 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
# 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, develop, release]
paths:
- 'demos/python/sdk_wireless_camera_control/**'
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
python-version: ['3.9', '3.10', '3.11']
include:
- os: ubuntu-latest
path: ~/.cache/pip
- os: macos-latest
path: ~/Library/Caches/pip
- os: windows-latest
path: ~\AppData\Local\pip\Cache
steps:
- name: Checkout source branch
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Check for cached pip environment
uses: actions/cache@v2
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: Perform checks (format, types, lint, docstrings, unit tests, docs, safety)
working-directory: ./demos/python/sdk_wireless_camera_control/
run: nox -p ${{ matrix.python-version }}
# Only test docs on ubuntu since we need graphviz
- name: Test docs build
if: ${{ matrix.os == 'ubuntu-latest'}}
run: nox -s docs
- name: Archive test report on failure
uses: actions/upload-artifact@v2
if: failure()
with:
name: test-reports
path: ./demos/python/sdk_wireless_camera_control/.reports
retention-days: 2