Skip to content

Commit 9a9dbb2

Browse files
author
Michael Johansen
committed
Initial submission of workflow files with simplified CI.
Signed-off-by: Michael Johansen <michael.johansen@ni.com> Fix the working directory setting. Signed-off-by: Michael Johansen <michael.johansen@ni.com> Specify working directory for pyright. Signed-off-by: Michael Johansen <michael.johansen@ni.com> I put the input in the wrong spot. Signed-off-by: Michael Johansen <michael.johansen@ni.com> Remove unused workflows. They will be added in later. Signed-off-by: Michael Johansen <michael.johansen@ni.com>
1 parent fe47d4a commit 9a9dbb2

9 files changed

Lines changed: 158 additions & 0 deletions

File tree

.github/workflows/CI.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
jobs:
12+
check_ni_protobuf_types:
13+
name: Check ni.protobuf.types
14+
uses: ./.github/workflows/check_ni_protobuf_types.yml
15+
check_ni_pythonpanel_v1_proto:
16+
name: Check ni.pythonpanel.v1.proto
17+
uses: ./.github/workflows/check_ni_pythonpanel_v1.yml

.github/workflows/PR.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: PR
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- 'releases/**'
8+
workflow_call:
9+
workflow_dispatch:
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
run_ci:
17+
name: Run CI
18+
uses: ./.github/workflows/CI.yml
19+
permissions:
20+
contents: read
21+
checks: write
22+
pull-requests: write
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Check ni.protobuf.types
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
check_package:
9+
name: Check ni.protobuf.types
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
# Set the working-directory for all steps in this job.
14+
working-directory: ./packages/ni.protobuf.types
15+
steps:
16+
- name: Check out repo
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- name: Set up Python
19+
uses: ni/python-actions/setup-python@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
20+
id: setup-python
21+
- name: Set up Poetry
22+
uses: ni/python-actions/setup-poetry@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
23+
- name: Check for lock changes
24+
run: poetry check --lock
25+
- name: Cache virtualenv
26+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
27+
with:
28+
path: packages/ni.protobuf.types/.venv
29+
key: ni.protobuf.types-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('packages/ni.protobuf.types/poetry.lock') }}
30+
- name: Install ni.protobuf.types
31+
run: poetry install -v
32+
- name: Lint
33+
run: poetry run ni-python-styleguide lint
34+
- name: Mypy static analysis (Linux)
35+
run: poetry run mypy
36+
- name: Mypy static analysis (Windows)
37+
run: poetry run mypy --platform win32
38+
- name: Bandit security checks
39+
run: poetry run bandit -c pyproject.toml -r src/ni/protobuf
40+
- name: Add virtualenv to the path for pyright-action
41+
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
42+
- name: Pyright static analysis (Linux)
43+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
44+
with:
45+
python-platform: Linux
46+
version: PATH
47+
working-directory: ./packages/ni.protobuf.types
48+
- name: Pyright static analysis (Windows)
49+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
50+
with:
51+
python-platform: Windows
52+
version: PATH
53+
working-directory: ./packages/ni.protobuf.types
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Check ni.pythonpanel.v1.proto
2+
3+
on:
4+
workflow_call:
5+
workflow_dispatch:
6+
7+
jobs:
8+
check_package:
9+
name: Check ni.pythonpanel.v1.proto
10+
runs-on: ubuntu-latest
11+
defaults:
12+
run:
13+
# Set the working-directory for all steps in this job.
14+
working-directory: ./packages/ni.pythonpanel.v1.proto
15+
steps:
16+
- name: Check out repo
17+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
18+
- name: Set up Python
19+
uses: ni/python-actions/setup-python@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
20+
id: setup-python
21+
- name: Set up Poetry
22+
uses: ni/python-actions/setup-poetry@a3bfe1baa6062fd6157683651d653d527967d4d4 # v0.3.1
23+
- name: Check for lock changes
24+
run: poetry check --lock
25+
- name: Cache virtualenv
26+
uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
27+
with:
28+
path: .venv
29+
key: ni.pythonpanel.v1.proto-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
30+
- name: Install ni.pythonpanel.v1.proto
31+
run: poetry install -v
32+
- name: Lint
33+
run: poetry run ni-python-styleguide lint
34+
- name: Mypy static analysis (Linux)
35+
run: poetry run mypy
36+
- name: Mypy static analysis (Windows)
37+
run: poetry run mypy --platform win32
38+
- name: Bandit security checks
39+
run: poetry run bandit -c pyproject.toml -r src/ni/pythonpanel/v1
40+
- name: Add virtualenv to the path for pyright-action
41+
run: echo "$(poetry env info --path)/bin" >> $GITHUB_PATH
42+
- name: Pyright static analysis (Linux)
43+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
44+
with:
45+
python-platform: Linux
46+
version: PATH
47+
working-directory: ./packages/ni.pythonpanel.v1.proto
48+
- name: Pyright static analysis (Windows)
49+
uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2
50+
with:
51+
python-platform: Windows
52+
version: PATH
53+
working-directory: ./packages/ni.pythonpanel.v1.proto
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Package for ni.protobuf.types."""
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""This is a placeholder file for the package while we implement code generation."""
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Tests for the ni.protobuf.types package."""
2+
3+
4+
def test___placeholder() -> None:
5+
pass
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Package for ni.pythonpanel.v1.proto."""
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
"""Tests for the ni.pythonpanel.v1.proto package."""
2+
3+
4+
def test___placeholder() -> None:
5+
pass

0 commit comments

Comments
 (0)