Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update action files and nox #534

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/github-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
copyright:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
token: ${{ secrets.PUSH_TO_PROTECTED_BRANCH }}

Expand All @@ -27,8 +27,8 @@ jobs:
shell: bash
run: |
git config core.fileMode false
git config user.name github-actions
git config user.email github-actions@github.com
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add .
git commit -m "updating copyrights from pre merge check in github action"
git push
Expand All @@ -41,7 +41,7 @@ jobs:
build_python_sdk: ${{ steps.check_files.outputs.found_modified_python_file }}
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 2

Expand Down Expand Up @@ -76,7 +76,7 @@ jobs:

steps:
- name: Checkout source branch (the PR branch)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
path: source

Expand All @@ -90,27 +90,28 @@ jobs:
python-version: 3.11.4

- name: Restore cached pip environment
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-3.9.10-pip-${{ hashFiles('demos/python/sdk_wireless_camera_control/poetry.lock') }}
key: ${{ runner.os }}-3.11.4-pip-${{ hashFiles('demos/python/sdk_wireless_camera_control/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Install dependencies
working-directory: ./source/demos/python/sdk_wireless_camera_control/
run: |
python -m pip install --upgrade pip wheel
pip install nox==2023.4.22
pip install nox==2024.4.15
pip install nox-poetry==1.0.3
pip install poetry
pip install poetry-plugin-export

- name: Build Sphinx Documentation
working-directory: ./source/demos/python/sdk_wireless_camera_control/
run: nox -s docs

- name: Checkout target branch (the gh-pages branch)
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: gh-pages
path: target
Expand All @@ -122,7 +123,7 @@ jobs:
cp -r ./source/demos/python/sdk_wireless_camera_control/docs/build/. ./target/python_sdk
cd ./target/python_sdk
git add .
git config user.name github-actions
git config user.email github-actions@github.com
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git commit --allow-empty -m "sphinx build from Action ${GITHUB_SHA}"
git push
2 changes: 1 addition & 1 deletion .github/workflows/publish_python_sdk.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Build and publish to pypi
uses: JRubics/[email protected]
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/python_sdk_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ jobs:
path: ~\AppData\Local\pip\Cache
steps:
- name: Checkout source branch
uses: actions/checkout@v3
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@v2
uses: actions/cache@v4
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('demos/python/sdk_wireless_camera_control/poetry.lock') }}
Expand All @@ -53,15 +53,15 @@ jobs:
pip install nox-poetry==1.0.3
pip install poetry

- name: Perform checks (format, types, lint, docstrings, unit tests)
- name: Unit Testing for all cases
working-directory: ./demos/python/sdk_wireless_camera_control/
run: nox -p ${{ matrix.python-version }}
run: nox -p ${{ matrix.python-version }} -s tests

# Only test docs with latest Python on ubuntu since we need graphviz
- name: Test docs build
- 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 -s docs
run: nox -p 3.11 -s format lint docstrings docs

- name: Archive test report on failure
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion demos/python/sdk_wireless_camera_control/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from nox_poetry import session

# Don't run docs by default since it needs graphviz.
nox.options.sessions = "format", "lint", "tests", "docstrings"
nox.options.sessions = "format", "lint", "tests", "docstrings", "docs"

SUPPORTED_VERSIONS = [
"3.9",
Expand Down
Loading