77jobs :
88 check_nims :
99 name : Check NIMS
10- runs-on : ubuntu-latest
10+ env :
11+ oldest-python-version : ' 3.9'
12+ strategy :
13+ matrix :
14+ os : [windows-latest, ubuntu-latest, macos-latest]
15+ python-version : [3.9, 3.13]
16+ runs-on : ${{ matrix.os }}
1117 defaults :
1218 run :
1319 # Set the working-directory for all steps in this job.
@@ -20,64 +26,27 @@ jobs:
2026 - name : Set up Python
2127 uses : ni/python-actions/setup-python@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
2228 id : setup-python
29+ with :
30+ python-version : ${{ matrix.python-version }}
2331 - name : Set up Poetry
2432 uses : ni/python-actions/setup-poetry@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
25- - name : Check for lock changes (ni-measurement-plugin-sdk-service)
26- run : poetry check --lock
27-
28- # ni-measurement-plugin-sdk-service, all extras
29- - name : Restore cached virtualenv (ni-measurement-plugin-sdk-service, all extras)
30- uses : actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
31- id : restore-nims-all-extras
33+ - name : Analyze generator
34+ uses : ni/python-actions/analyze-project@9768589f3e50672173dad75a6fc181e4a85d33fa # v0.7.0
3235 with :
33- path : packages/service/.venv
34- key : ni-measurement-plugin-sdk-service-all-extras-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('packages/service/poetry.lock') }}
35- - name : Install ni-measurement-plugin-sdk-service (all extras)
36- run : poetry install -v --all-extras
37- - name : Save cached virtualenv (ni-measurement-plugin-sdk-service, all extras)
38- uses : actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
39- if : steps.restore-nims-all-extras.outputs.cache-hit != 'true'
40- with :
41- path : packages/service/.venv
42- key : ${{ steps.restore-nims-all-extras.outputs.cache-primary-key }}
43- - name : Lint ni-measurement-plugin-sdk-service
44- run : poetry run ni-python-styleguide lint
45- - name : Mypy static analysis (ni-measurement-plugin-sdk-service, Linux)
46- run : poetry run mypy
47- - name : Mypy static analysis (ni-measurement-plugin-sdk-service, Windows)
48- run : poetry run mypy --platform win32
36+ project-directory : packages/service
37+ install-args : --all-extras
4938 - name : Bandit security checks (ni-measurement-plugin-sdk-service)
5039 run : poetry run bandit -c pyproject.toml -r ni_measurement_plugin_sdk_service
51-
52- # ni-measurement-plugin-sdk-service, all extras, docs
53- - name : Restore cached virtualenv (ni-measurement-plugin-sdk-service, all extras, docs)
54- uses : actions/cache/restore@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
55- id : restore-nims-all-extras-docs
56- with :
57- path : packages/service/.venv
58- key : ni-measurement-plugin-sdk-service-all-extras-docs-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('packages/service/poetry.lock') }}
59- - name : Install ni-measurement-plugin-sdk-service (all extras, docs)
60- run : poetry install -v --all-extras --with docs
61- - name : Save cached virtualenv (ni-measurement-plugin-sdk-service, all extras, docs)
62- uses : actions/cache/save@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4
63- if : steps.restore-nims-all-extras-docs.outputs.cache-hit != 'true'
64- with :
65- path : packages/service/.venv
66- key : ${{ steps.restore-nims-all-extras-docs.outputs.cache-primary-key }}
67- - name : Build docs and check for errors/warnings
68- run : |
69- rm -rf docs
70- mkdir -p docs
71- poetry run sphinx-build _docs_source docs -b html -W
72- - name : Revert docs
73- run : rm -rf docs
7440 - name : Generate gRPC stubs
41+ if : matrix.python-version == env.oldest-python-version
7542 run : |
7643 find tests/utilities/stubs/ -name \*_pb2.py\* -o -name \*_pb2_grpc.py\* -delete
7744 poetry run python scripts/generate_grpc_stubs.py
7845 - name : Check for out-of-date gRPC stubs
46+ if : matrix.python-version == env.oldest-python-version
7947 run : git diff --exit-code
8048 - name : Revert gRPC stubs
49+ if : matrix.python-version == env.oldest-python-version
8150 run : |
8251 git clean -dfx tests/utilities/stubs/
8352 git restore tests/utilities/stubs/
0 commit comments