-
Notifications
You must be signed in to change notification settings - Fork 21
53 lines (50 loc) · 2.05 KB
/
Copy pathcheck_nimg.yml
File metadata and controls
53 lines (50 loc) · 2.05 KB
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
name: Check NIMG
on:
workflow_call:
workflow_dispatch:
permissions: {}
jobs:
check_nimg:
name: Check NIMG
env:
oldest-python-version: '3.10'
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
python-version: ['3.10', 3.14]
runs-on: ${{ matrix.os }}
defaults:
run:
# Set the working-directory for all steps in this job.
working-directory: ./packages/generator
steps:
- name: Check out repo
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: ni/python-actions/setup-python@a2554c7e5680982d3355677b2290e48b60678744 # v0.8.0
id: setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Set up Poetry
uses: ni/python-actions/setup-poetry@a2554c7e5680982d3355677b2290e48b60678744 # v0.8.0
- name: Analyze generator
uses: ni/python-actions/analyze-project@a2554c7e5680982d3355677b2290e48b60678744 # v0.8.0
with:
project-directory: packages/generator
- name: Bandit security checks (ni-measurement-plugin-sdk-generator, example_renders)
run: poetry run bandit -c pyproject.toml -r ni_measurement_plugin_sdk_generator tests/test_assets/example_renders
- name: Generate gRPC stubs
if: matrix.python-version == env.oldest-python-version
run: |
find tests/utilities/measurements/non_streaming_data_measurement/_stubs -name \*_pb2.py\* -o -name \*_pb2_grpc.py\* -delete
poetry run python scripts/generate_grpc_stubs.py
- name: Check for out-of-date gRPC stubs
if: matrix.python-version == env.oldest-python-version
run: git diff --exit-code
- name: Revert gRPC stubs
if: matrix.python-version == env.oldest-python-version
run: |
git clean -dfx tests/utilities/measurements/non_streaming_data_measurement/_stubs
git restore tests/utilities/measurements/non_streaming_data_measurement/_stubs