Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
17 changes: 17 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on:
push:
branches:
- main
- 'releases/**'
workflow_call:
workflow_dispatch:

jobs:
check_ni_protobuf_types:
name: Check ni.protobuf.types
uses: ./.github/workflows/check_ni_protobuf_types.yml
check_ni_pythonpanel_v1_proto:
name: Check ni.pythonpanel.v1.proto
uses: ./.github/workflows/check_ni_pythonpanel_v1.yml
22 changes: 22 additions & 0 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: PR

on:
pull_request:
branches:
- main
- 'releases/**'
workflow_call:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

jobs:
run_ci:
name: Run CI
uses: ./.github/workflows/CI.yml
permissions:
contents: read
checks: write
pull-requests: write
53 changes: 53 additions & 0 deletions .github/workflows/check_ni_protobuf_types.yml
Comment thread
mjohanse-emr marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Check ni.protobuf.types

on:
workflow_call:
workflow_dispatch:

jobs:
check_package:
name: Check ni.protobuf.types
runs-on: ubuntu-latest
defaults:
run:
# Set the working-directory for all steps in this job.
working-directory: ./packages/ni.protobuf.types
steps:
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: ni/python-actions/setup-python@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
id: setup-python
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
- name: Check for lock changes
run: poetry check --lock
- name: Cache virtualenv
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: packages/ni.protobuf.types/.venv
key: ni.protobuf.types-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('packages/ni.protobuf.types/poetry.lock') }}
- name: Install ni.protobuf.types
run: poetry install -v
- name: Lint
run: poetry run ni-python-styleguide lint
- name: Mypy static analysis (Linux)
run: poetry run mypy
- name: Mypy static analysis (Windows)
run: poetry run mypy --platform win32
- name: Bandit security checks
run: poetry run bandit -c pyproject.toml -r src/ni/protobuf
- name: Add virtualenv to the path for pyright-action
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
- name: Pyright static analysis (Linux)
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
with:
python-platform: Linux
version: PATH
working-directory: ./packages/ni.protobuf.types
- name: Pyright static analysis (Windows)
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
with:
python-platform: Windows
version: PATH
working-directory: ./packages/ni.protobuf.types
53 changes: 53 additions & 0 deletions .github/workflows/check_ni_pythonpanel_v1.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Check ni.pythonpanel.v1.proto

on:
workflow_call:
workflow_dispatch:

jobs:
check_package:
name: Check ni.pythonpanel.v1.proto
runs-on: ubuntu-latest
defaults:
run:
# Set the working-directory for all steps in this job.
working-directory: ./packages/ni.pythonpanel.v1.proto
steps:
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up Python
uses: ni/python-actions/setup-python@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
id: setup-python
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
- name: Check for lock changes
run: poetry check --lock
- name: Cache virtualenv
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
with:
path: .venv
key: ni.pythonpanel.v1.proto-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
- name: Install ni.pythonpanel.v1.proto
run: poetry install -v
- name: Lint
run: poetry run ni-python-styleguide lint
- name: Mypy static analysis (Linux)
run: poetry run mypy
- name: Mypy static analysis (Windows)
run: poetry run mypy --platform win32
- name: Bandit security checks
run: poetry run bandit -c pyproject.toml -r src/ni/pythonpanel/v1
- name: Add virtualenv to the path for pyright-action
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
- name: Pyright static analysis (Linux)
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
with:
python-platform: Linux
version: PATH
working-directory: ./packages/ni.pythonpanel.v1.proto
- name: Pyright static analysis (Windows)
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
with:
python-platform: Windows
version: PATH
working-directory: ./packages/ni.pythonpanel.v1.proto
1 change: 1 addition & 0 deletions packages/ni.protobuf.types/src/ni/protobuf/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Package for ni.protobuf.types."""
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""This is a placeholder file for the package while we implement code generation."""
5 changes: 5 additions & 0 deletions packages/ni.protobuf.types/tests/test_placeholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Tests for the ni.protobuf.types package."""


def test___placeholder() -> None:
pass
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"""Package for ni.pythonpanel.v1.proto."""
5 changes: 5 additions & 0 deletions packages/ni.pythonpanel.v1.proto/tests/test_placeholder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
"""Tests for the ni.pythonpanel.v1.proto package."""


def test___placeholder() -> None:
pass