From 294de53ce002ed29bceeaa56ccb6c9c8894c3458 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Thu, 4 Sep 2025 14:56:46 -0700 Subject: [PATCH 01/24] Add new outputs to get_package_info - package-basepath - should-check-codegen - should-check-docs - should-run-tests Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/get_package_info.yml | 58 +++++++++++++++++++++++--- 1 file changed, 53 insertions(+), 5 deletions(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index 772c0794..b1544d28 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -9,6 +9,9 @@ on: required: true type: string outputs: + package-basepath: + description: 'The parent directory of the package.' + value: ${{ jobs.get_package_info.outputs.package-basepath }} proto-basepath: description: 'Base path for proto files.' value: ${{ jobs.get_package_info.outputs.proto-basepath }} @@ -24,17 +27,30 @@ on: install-drivers: description: 'Whether to install drivers extra' value: ${{ jobs.get_package_info.outputs.install-drivers }} + should-check-codegen: + description: 'Whether to check protobuf code generation' + value: ${{ jobs.get_package_info.outputs.should-check-codegen }} + should-check-docs: + description: 'Whether to check documentation generation' + value: ${{ jobs.get_package_info.outputs.should-check-docs }} + should-run-tests: + description: 'Whether to run automated tests' + value: ${{ jobs.get_package_info.outputs.should-run-tests }} jobs: get_package_info: name: Get package info for ${{ inputs.package-name }} runs-on: ubuntu-latest outputs: + package-basepath: ${{ steps.parse_json.outputs.package-basepath }} proto-basepath: ${{ steps.parse_json.outputs.proto-basepath }} proto-subpath: ${{ steps.parse_json.outputs.proto-subpath }} proto-include-path: ${{ steps.parse_json.outputs.proto-include-path }} output-format: ${{ steps.parse_json.outputs.output-format }} install-drivers: ${{ steps.parse_json.outputs.install-drivers }} + should-check-codegen: ${{ steps.parse_json.outputs.should-check-codegen }} + should-check-docs: ${{ steps.parse_json.outputs.should-check-docs }} + should-run-tests: ${{ steps.parse_json.outputs.should-run-tests }} steps: - name: Check out repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -48,8 +64,40 @@ jobs: exit 1 fi echo "Package info: $info" - echo "proto-basepath=$(echo $info | jq -r '."proto-basepath"')" >> $GITHUB_OUTPUT - echo "proto-subpath=$(echo $info | jq -r '."proto-subpath"')" >> $GITHUB_OUTPUT - echo "proto-include-path=$(echo $info | jq -r '."proto-include-path"')" >> $GITHUB_OUTPUT - echo "output-format=$(echo $info | jq -r '."output-format"')" >> $GITHUB_OUTPUT - echo "install-drivers=$(echo $info | jq -r '."install-drivers"')" >> $GITHUB_OUTPUT \ No newline at end of file + package_basepath=$(echo $info | jq -r '."package-basepath"') + proto_basepath=$(echo $info | jq -r '."proto-basepath"') + proto_subpath=$(echo $info | jq -r '."proto-subpath"') + proto_include_path=$(echo $info | jq -r '."proto-include-path"') + output_format=$(echo $info | jq -r '."output-format"') + install_drivers=$(echo $info | jq -r '."install-drivers"') + + should_check_codegen=false + if [ "${proto_subpath}" != "null" ] + then + should_check_codegen=true + fi + + should_check_docs=false + if [ -d "${GITHUB_WORKSPACE}/${package_basepath}/${{ inputs.package-name }}/docs" ] + then + should_check_docs=true + fi + + should_run_tests=false + if [ -d "${GITHUB_WORKSPACE}/${package_basepath}/${{ inputs.package-name }}/tests" ] + then + should_run_tests=true + fi + + echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT + echo "proto-basepath="${proto_basepath} >> $GITHUB_OUTPUT + echo "proto-subpath=${proto_subpath}" >> $GITHUB_OUTPUT + echo "proto-include-path=${proto_include_path}" >> $GITHUB_OUTPUT + echo "output-format=${output_format}" >> $GITHUB_OUTPUT + echo "install-drivers=${install_drivers}" >> $GITHUB_OUTPUT + echo "should-check-codegen=${should_check_codegen}" >> $GITHUB_OUTPUT + echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT + echo "should-run-tests=${should_run_tests}" >> $GITHUB_OUTPUT + - name: Show package info + run: | + echo "${{ toJSON(steps.parse_json.outputs) }}" From 216cde65bfa4b3a49ee2141a9ca2960750d388c6 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:03:28 -0700 Subject: [PATCH 02/24] Rename 'package-base-path' to 'package-basepath' Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_analyzers.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index 55e6504f..76e7d57f 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -8,7 +8,7 @@ on: default: '' required: true type: string - package-base-path: + package-basepath: description: 'The parent directory of the package to check. Defaults to packages.' default: 'packages' required: false @@ -26,7 +26,7 @@ jobs: defaults: run: # Set the working-directory for all steps in this job. - working-directory: ./${{ inputs.package-base-path }}/${{ inputs.package-name }} + working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} steps: - name: Check out repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -42,8 +42,8 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: ${{ inputs.package-base-path }}/${{ inputs.package-name }}/.venv - key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-base-path, inputs.package-name)) }} + path: ${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv + key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: | if [ "${{ inputs.install-drivers }}" = "true" ]; then @@ -66,10 +66,10 @@ jobs: with: python-platform: Linux version: PATH - working-directory: ./${{ inputs.package-base-path }}/${{ inputs.package-name }} + working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} - name: Pyright static analysis (Windows) uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2 with: python-platform: Windows version: PATH - working-directory: ./${{ inputs.package-base-path }}/${{ inputs.package-name }} + working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} From 1d56a3d72c6a86b04d16ae070867bba844286eb4 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:04:24 -0700 Subject: [PATCH 03/24] Use all JSON keys for each package info object - Prefer null objects to empty Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- packages.json | 81 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 62 insertions(+), 19 deletions(-) diff --git a/packages.json b/packages.json index c5a666f9..d3c2c878 100644 --- a/packages.json +++ b/packages.json @@ -1,87 +1,130 @@ { + "grpc_generator": { + "package-basepath": "tools", + "proto-basepath": null, + "proto-subpath": null, + "proto-include-path": null, + "output-format": null, + "install-drivers": null + }, "ni.datamonikers.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/datamonikers/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni-grpc-extensions" : { - "proto-subpath": "", - "output-format": "" + "package-basepath": "packages", + "proto-basepath": null, + "proto-subpath": null, + "proto-include-path": null, + "output-format": null, + "install-drivers": null }, "ni.grpcdevice.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./proto", "proto-subpath": ".", "proto-include-path": "./proto", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurementlink.discovery.v1.client": { - "proto-subpath": "", - "output-format": "" + "package-basepath": "packages", + "proto-basepath": null, + "proto-subpath": null, + "proto-include-path": null, + "output-format": null, + "install-drivers": null }, "ni.measurementlink.discovery.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/discovery/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurementlink.measurement.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurementlink.measurement.v2.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v2", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurementlink.pinmap.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/pinmap/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurementlink.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurementlink.sessionmanagement.v1.client": { - "proto-subpath": "", - "output-format": "", + "package-basepath": "packages", + "proto-basepath": null, + "proto-subpath": null, + "proto-include-path": null, + "output-format": null, "install-drivers": true }, "ni.measurementlink.sessionmanagement.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/sessionmanagement/v1", "proto-include-path": "./third_party/ni-apis/ni/grpcdevice/v1", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurements.data.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurements/data/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.measurements.metadata.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurements/metadata/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "subpackage" + "output-format": "subpackage", + "install-drivers": null }, "ni.panels.v1.proto": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/panels/v1", "proto-include-path": "./third_party/ni-apis", - "output-format": "submodule" + "output-format": "submodule", + "install-drivers": null }, "ni.protobuf.types": { + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/protobuf/types", "proto-include-path": "./third_party/ni-apis", - "output-format": "submodule" + "output-format": "submodule", + "install-drivers": null } -} \ No newline at end of file +} From af0b453e565686ddb33f2ec35db96caa71b02826 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:05:14 -0700 Subject: [PATCH 04/24] Add and use input for package-basepath to check_docs.yml Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_docs.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index 81cdea43..69db5681 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -8,6 +8,11 @@ on: default: '' required: true type: string + package-basepath: + description: 'The parent directory of the package.' + default: '' + required: true + type: string jobs: check_docs: @@ -16,7 +21,7 @@ jobs: defaults: run: # Set the working-directory for all steps in this job. - working-directory: ./packages/${{ inputs.package-name }} + working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} steps: - name: Check out repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -31,7 +36,7 @@ jobs: uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: path: .venv - key: ${{ inputs.package-name }}-with-docs-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('packages/{0}/poetry.lock', inputs.package-name)) }} + key: ${{ inputs.package-name }}-with-docs-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install nitypes (with docs) run: poetry install -v --only main,docs - name: Generate docs @@ -40,4 +45,4 @@ jobs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ inputs.package-name }}-docs - path: packages/${{ inputs.package-name }}/docs/_build/ \ No newline at end of file + path: ${{ inputs.package-basepath }}/${{ inputs.package-name }}/docs/_build/ From 773e047b1cc961ed1b5e9711a7d924fe9bc8add2 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:06:45 -0700 Subject: [PATCH 05/24] Use new package info outputs in check_package.yml to skip unneeded jobs Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_package.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 8ddbdfec..4e76d825 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -16,7 +16,7 @@ jobs: with: package-name: ${{ inputs.package-name }} check_codegen: - if: ${{ needs.get_package_info.outputs.proto-subpath != '' }} + if: ${{ needs.get_package_info.outputs.should-check-codegen == 'true' }} name: Check codegen for ${{ inputs.package-name }} needs: get_package_info uses: ./.github/workflows/check_codegen.yml @@ -25,7 +25,7 @@ jobs: proto-basepath: ${{ needs.get_package_info.outputs.proto-basepath }} proto-subpath: ${{ needs.get_package_info.outputs.proto-subpath }} proto-include-path: ${{ needs.get_package_info.outputs.proto-include-path }} - output-basepath: ./packages/${{ inputs.package-name }}/src + output-basepath: ./${{ needs.get_package_info.outputs.package-basepath }}/${{ inputs.package-name }}/src output-format: ${{ needs.get_package_info.outputs.output-format }} check_analyzers: name: Check analyzers for ${{ inputs.package-name }} @@ -33,9 +33,13 @@ jobs: uses: ./.github/workflows/check_analyzers.yml with: package-name: ${{ inputs.package-name }} + package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} install-drivers: ${{ needs.get_package_info.outputs.install-drivers == 'true' }} check_docs: + if: ${{ needs.get_package_info.outputs.should-check-docs == 'true' }} name: Check docs for ${{ inputs.package-name }} + needs: get_package_info uses: ./.github/workflows/check_docs.yml with: - package-name: ${{ inputs.package-name }} \ No newline at end of file + package-name: ${{ inputs.package-name }} + package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} From 999f6aec653038815afb86fa433707e68171c8e2 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Thu, 4 Sep 2025 15:07:08 -0700 Subject: [PATCH 06/24] Remove special treatment for grpc_generator in the CI Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/CI.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 861f3213..6ce93b0f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -21,22 +21,16 @@ jobs: uses: ./.github/workflows/check_package.yml with: package-name: ${{ matrix.package-name }} - check_analyzers_grpc_gen: - name: Check analyzers for grpc_generator - uses: ./.github/workflows/check_analyzers.yml - with: - package-name: grpc_generator - package-base-path: tools run_unit_tests: name: Run unit tests uses: ./.github/workflows/run_unit_tests.yml - needs: [check_package, check_analyzers_grpc_gen] + needs: check_package report_test_results: name: Report test results uses: ./.github/workflows/report_test_results.yml - needs: [run_unit_tests] + needs: run_unit_tests if: always() permissions: contents: read checks: write - pull-requests: write \ No newline at end of file + pull-requests: write From fe2bb54407877799966e15888857d98c2fdbedf5 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 12:38:46 -0700 Subject: [PATCH 07/24] Do not echo back the parsed JSON Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/get_package_info.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index b1544d28..dedb785b 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -63,7 +63,7 @@ jobs: echo "Error: Package '${{ inputs.package-name }}' not found in packages.json." >&2 exit 1 fi - echo "Package info: $info" + package_basepath=$(echo $info | jq -r '."package-basepath"') proto_basepath=$(echo $info | jq -r '."proto-basepath"') proto_subpath=$(echo $info | jq -r '."proto-subpath"') From f45325d519d00a6ce0c19f7cd04c82c8cf43f9a5 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 12:43:51 -0700 Subject: [PATCH 08/24] Incorporate the new no-proto pinmap client package Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- packages.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages.json b/packages.json index 3cd5aeaa..be15cde6 100644 --- a/packages.json +++ b/packages.json @@ -64,8 +64,12 @@ "install-drivers": null }, "ni.measurementlink.pinmap.v1.client": { - "proto-subpath": "", - "output-format": "" + "package-basepath": "packages", + "proto-basepath": null, + "proto-subpath": null, + "proto-include-path": null, + "output-format": null, + "install-drivers": null }, "ni.measurementlink.pinmap.v1.proto": { "package-basepath": "packages", From 013f42c1d1d768a1927b848cca9cbd6f286b3f1d Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:03:23 -0700 Subject: [PATCH 09/24] Add the github workspace path segment to all working-directory parameters Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/actions/run_and_upload_unit_tests/action.yml | 6 +++--- .github/workflows/check_analyzers.yml | 6 +++--- .github/workflows/check_codegen.yml | 2 +- .github/workflows/check_docs.yml | 2 +- .github/workflows/publish.yml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/run_and_upload_unit_tests/action.yml b/.github/actions/run_and_upload_unit_tests/action.yml index e8f2606e..7a893e19 100644 --- a/.github/actions/run_and_upload_unit_tests/action.yml +++ b/.github/actions/run_and_upload_unit_tests/action.yml @@ -18,15 +18,15 @@ runs: key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ env.pythonVersion }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: poetry install -v - working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} + working-directory: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }} shell: bash - name: Run ${{ inputs.package-name }} unit tests and code coverage run: poetry run pytest ./tests/unit -v --cov=${{ inputs.package-name }} --junitxml=test_results/${{ inputs.package-name }}-${{ matrix.os }}-py${{ matrix.python-version }}.xml - working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} + working-directory: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }} shell: bash - name: Upload ${{ inputs.package-name }} test results uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ matrix.python-version }} path: ./${{ inputs.package-basepath }}/${{ inputs.package-name }}/test_results/*.xml - if: always() \ No newline at end of file + if: always() diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index 76e7d57f..c8823fdb 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -26,7 +26,7 @@ jobs: defaults: run: # Set the working-directory for all steps in this job. - working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} + working-directory: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }} steps: - name: Check out repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -66,10 +66,10 @@ jobs: with: python-platform: Linux version: PATH - working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} + working-directory: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }} - name: Pyright static analysis (Windows) uses: jakebailey/pyright-action@b5d50e5cde6547546a5c4ac92e416a8c2c1a1dfe # v2.3.2 with: python-platform: Windows version: PATH - working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} + working-directory: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }} diff --git a/.github/workflows/check_codegen.yml b/.github/workflows/check_codegen.yml index f5e2d22d..86197533 100644 --- a/.github/workflows/check_codegen.yml +++ b/.github/workflows/check_codegen.yml @@ -39,7 +39,7 @@ jobs: defaults: run: # Set the working-directory for all steps in this job. - working-directory: ./tools/grpc_generator + working-directory: ${{ github.workspace }}/tools/grpc_generator steps: - name: Validate package name if: ${{ !endsWith(inputs.package-name, '.proto') && inputs.package-name != 'ni.protobuf.types' }} diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index 69db5681..beef5c84 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -21,7 +21,7 @@ jobs: defaults: run: # Set the working-directory for all steps in this job. - working-directory: ./${{ inputs.package-basepath }}/${{ inputs.package-name }} + working-directory: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }} steps: - name: Check out repo uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 35413a2d..f897780e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -102,7 +102,7 @@ jobs: expected-version: ${{ needs.get_package_info.outputs.package-version }} - name: Build distribution packages run: poetry build - working-directory: ./packages/${{ needs.get_package_info.outputs.package-name }} + working-directory: ${{ github.workspace }}//packages/${{ needs.get_package_info.outputs.package-name }} - name: Upload build artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: @@ -126,7 +126,7 @@ jobs: name: ${{ needs.get_package_info.outputs.package-name }}-distribution-packages path: ./packages/${{ needs.get_package_info.outputs.package-name }}/dist/ - run: ls -lR - working-directory: ./packages/${{ needs.get_package_info.outputs.package-name }} + working-directory: ${{ github.workspace }}//packages/${{ needs.get_package_info.outputs.package-name }} - name: Upload to ${{ env.environment }} uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 with: From 3b3ff128a1c87bcf8ba94d844f23bc9b7de1c638 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:13:29 -0700 Subject: [PATCH 10/24] Hint that package-basepath is relative with a ./ prefix Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- packages.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages.json b/packages.json index be15cde6..fc413c88 100644 --- a/packages.json +++ b/packages.json @@ -1,6 +1,6 @@ { "grpc_generator": { - "package-basepath": "tools", + "package-basepath": "./tools", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -8,7 +8,7 @@ "install-drivers": null }, "ni.datamonikers.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/datamonikers/v1", "proto-include-path": "./third_party/ni-apis", @@ -16,7 +16,7 @@ "install-drivers": null }, "ni-grpc-extensions" : { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -24,7 +24,7 @@ "install-drivers": null }, "ni.grpcdevice.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./proto", "proto-subpath": ".", "proto-include-path": "./proto", @@ -32,7 +32,7 @@ "install-drivers": null }, "ni.measurementlink.discovery.v1.client": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -40,7 +40,7 @@ "install-drivers": null }, "ni.measurementlink.discovery.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/discovery/v1", "proto-include-path": "./third_party/ni-apis", @@ -48,7 +48,7 @@ "install-drivers": null }, "ni.measurementlink.measurement.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v1", "proto-include-path": "./third_party/ni-apis", @@ -56,7 +56,7 @@ "install-drivers": null }, "ni.measurementlink.measurement.v2.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v2", "proto-include-path": "./third_party/ni-apis", @@ -64,7 +64,7 @@ "install-drivers": null }, "ni.measurementlink.pinmap.v1.client": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -72,7 +72,7 @@ "install-drivers": null }, "ni.measurementlink.pinmap.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/pinmap/v1", "proto-include-path": "./third_party/ni-apis", @@ -80,7 +80,7 @@ "install-drivers": null }, "ni.measurementlink.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink", "proto-include-path": "./third_party/ni-apis", @@ -88,7 +88,7 @@ "install-drivers": null }, "ni.measurementlink.sessionmanagement.v1.client": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -96,7 +96,7 @@ "install-drivers": true }, "ni.measurementlink.sessionmanagement.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/sessionmanagement/v1", "proto-include-path": "./third_party/ni-apis/ni/grpcdevice/v1", @@ -104,7 +104,7 @@ "install-drivers": null }, "ni.measurements.data.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurements/data/v1", "proto-include-path": "./third_party/ni-apis", @@ -112,7 +112,7 @@ "install-drivers": null }, "ni.measurements.metadata.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurements/metadata/v1", "proto-include-path": "./third_party/ni-apis", @@ -120,7 +120,7 @@ "install-drivers": null }, "ni.panels.v1.proto": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/panels/v1", "proto-include-path": "./third_party/ni-apis", @@ -128,7 +128,7 @@ "install-drivers": null }, "ni.protobuf.types": { - "package-basepath": "packages", + "package-basepath": "./packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/protobuf/types", "proto-include-path": "./third_party/ni-apis", From 99a480117ce016d60e447f85df42b7177fceb33d Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 13:47:35 -0700 Subject: [PATCH 11/24] Use absolute basepaths for all step inputs Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/actions/run_and_upload_unit_tests/action.yml | 4 ++-- .github/workflows/check_analyzers.yml | 2 +- .github/workflows/check_docs.yml | 2 +- .github/workflows/check_package.yml | 10 +++++----- .github/workflows/run_unit_tests.yml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/actions/run_and_upload_unit_tests/action.yml b/.github/actions/run_and_upload_unit_tests/action.yml index 7a893e19..d72df749 100644 --- a/.github/actions/run_and_upload_unit_tests/action.yml +++ b/.github/actions/run_and_upload_unit_tests/action.yml @@ -14,7 +14,7 @@ runs: - name: Cache ${{ inputs.package-name }} virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: ./${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ env.pythonVersion }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: poetry install -v @@ -28,5 +28,5 @@ runs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: test_results_unit_${{ inputs.package-name }}_${{ matrix.os }}_py${{ matrix.python-version }} - path: ./${{ inputs.package-basepath }}/${{ inputs.package-name }}/test_results/*.xml + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/test_results/*.xml if: always() diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index c8823fdb..faaff926 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -42,7 +42,7 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: ${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: | diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index beef5c84..f8016cd3 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -45,4 +45,4 @@ jobs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ inputs.package-name }}-docs - path: ${{ inputs.package-basepath }}/${{ inputs.package-name }}/docs/_build/ + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/docs/_build/ diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 4e76d825..053a99a8 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -22,10 +22,10 @@ jobs: uses: ./.github/workflows/check_codegen.yml with: package-name: ${{ inputs.package-name }} - proto-basepath: ${{ needs.get_package_info.outputs.proto-basepath }} + proto-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.proto-basepath }} proto-subpath: ${{ needs.get_package_info.outputs.proto-subpath }} - proto-include-path: ${{ needs.get_package_info.outputs.proto-include-path }} - output-basepath: ./${{ needs.get_package_info.outputs.package-basepath }}/${{ inputs.package-name }}/src + proto-include-path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.proto-include-path }} + output-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/${{ inputs.package-name }}/src output-format: ${{ needs.get_package_info.outputs.output-format }} check_analyzers: name: Check analyzers for ${{ inputs.package-name }} @@ -33,7 +33,7 @@ jobs: uses: ./.github/workflows/check_analyzers.yml with: package-name: ${{ inputs.package-name }} - package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} install-drivers: ${{ needs.get_package_info.outputs.install-drivers == 'true' }} check_docs: if: ${{ needs.get_package_info.outputs.should-check-docs == 'true' }} @@ -42,4 +42,4 @@ jobs: uses: ./.github/workflows/check_docs.yml with: package-name: ${{ inputs.package-name }} - package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 00d34408..6cd7a55e 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -61,4 +61,4 @@ jobs: uses: ./.github/actions/run_and_upload_unit_tests with: package-name: grpc_generator - package-basepath: tools + package-basepath: ${{ github.workspace }}/tools From 1d5df596c42e359f5e3fc4a2c93f02724a979077 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:08:57 -0700 Subject: [PATCH 12/24] Revert the workspace root for check analyzers Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_analyzers.yml | 2 +- .github/workflows/publish.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index faaff926..190a4fa0 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -42,7 +42,7 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv + path: ./${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f897780e..8036fb37 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -126,7 +126,7 @@ jobs: name: ${{ needs.get_package_info.outputs.package-name }}-distribution-packages path: ./packages/${{ needs.get_package_info.outputs.package-name }}/dist/ - run: ls -lR - working-directory: ${{ github.workspace }}//packages/${{ needs.get_package_info.outputs.package-name }} + working-directory: ${{ github.workspace }}/packages/${{ needs.get_package_info.outputs.package-name }} - name: Upload to ${{ env.environment }} uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc # v1.12.4 with: From 2e3961169399ed1217b1a4e951f21932c08d5845 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:22:34 -0700 Subject: [PATCH 13/24] Rely on the working directory for the venv path to cache Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_analyzers.yml | 6 +++--- .github/workflows/check_codegen.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index 190a4fa0..3780d5d8 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -10,8 +10,8 @@ on: type: string package-basepath: description: 'The parent directory of the package to check. Defaults to packages.' - default: 'packages' - required: false + default: '' + required: true type: string install-drivers: description: 'Whether to install drivers extras' @@ -42,7 +42,7 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: ./${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv + path: .venv key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: | diff --git a/.github/workflows/check_codegen.yml b/.github/workflows/check_codegen.yml index 86197533..b655cf55 100644 --- a/.github/workflows/check_codegen.yml +++ b/.github/workflows/check_codegen.yml @@ -58,7 +58,7 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: tools/grpc_generator/.venv + path: .venv key: grpc_generator-only-main-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('tools/grpc_generator/poetry.lock') }} - name: Install grpc_generator run: poetry install -v --only main From bbc2c4db1a31f7e8b5efdeb0108069b05f2a7fd1 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:24:35 -0700 Subject: [PATCH 14/24] Use relative paths for sub-action inputs Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 053a99a8..37cf13b3 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -33,7 +33,7 @@ jobs: uses: ./.github/workflows/check_analyzers.yml with: package-name: ${{ inputs.package-name }} - package-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ./${{ needs.get_package_info.outputs.package-basepath }} install-drivers: ${{ needs.get_package_info.outputs.install-drivers == 'true' }} check_docs: if: ${{ needs.get_package_info.outputs.should-check-docs == 'true' }} @@ -42,4 +42,4 @@ jobs: uses: ./.github/workflows/check_docs.yml with: package-name: ${{ inputs.package-name }} - package-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ./${{ needs.get_package_info.outputs.package-basepath }} From 728e49ed1cd6258db0837db9bc16ffa684aa735e Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:33:52 -0700 Subject: [PATCH 15/24] Revert ./ prefix in packages.json Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- packages.json | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/packages.json b/packages.json index fc413c88..be15cde6 100644 --- a/packages.json +++ b/packages.json @@ -1,6 +1,6 @@ { "grpc_generator": { - "package-basepath": "./tools", + "package-basepath": "tools", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -8,7 +8,7 @@ "install-drivers": null }, "ni.datamonikers.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/datamonikers/v1", "proto-include-path": "./third_party/ni-apis", @@ -16,7 +16,7 @@ "install-drivers": null }, "ni-grpc-extensions" : { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -24,7 +24,7 @@ "install-drivers": null }, "ni.grpcdevice.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./proto", "proto-subpath": ".", "proto-include-path": "./proto", @@ -32,7 +32,7 @@ "install-drivers": null }, "ni.measurementlink.discovery.v1.client": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -40,7 +40,7 @@ "install-drivers": null }, "ni.measurementlink.discovery.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/discovery/v1", "proto-include-path": "./third_party/ni-apis", @@ -48,7 +48,7 @@ "install-drivers": null }, "ni.measurementlink.measurement.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v1", "proto-include-path": "./third_party/ni-apis", @@ -56,7 +56,7 @@ "install-drivers": null }, "ni.measurementlink.measurement.v2.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v2", "proto-include-path": "./third_party/ni-apis", @@ -64,7 +64,7 @@ "install-drivers": null }, "ni.measurementlink.pinmap.v1.client": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -72,7 +72,7 @@ "install-drivers": null }, "ni.measurementlink.pinmap.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/pinmap/v1", "proto-include-path": "./third_party/ni-apis", @@ -80,7 +80,7 @@ "install-drivers": null }, "ni.measurementlink.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink", "proto-include-path": "./third_party/ni-apis", @@ -88,7 +88,7 @@ "install-drivers": null }, "ni.measurementlink.sessionmanagement.v1.client": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": null, "proto-subpath": null, "proto-include-path": null, @@ -96,7 +96,7 @@ "install-drivers": true }, "ni.measurementlink.sessionmanagement.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurementlink/sessionmanagement/v1", "proto-include-path": "./third_party/ni-apis/ni/grpcdevice/v1", @@ -104,7 +104,7 @@ "install-drivers": null }, "ni.measurements.data.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurements/data/v1", "proto-include-path": "./third_party/ni-apis", @@ -112,7 +112,7 @@ "install-drivers": null }, "ni.measurements.metadata.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/measurements/metadata/v1", "proto-include-path": "./third_party/ni-apis", @@ -120,7 +120,7 @@ "install-drivers": null }, "ni.panels.v1.proto": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/panels/v1", "proto-include-path": "./third_party/ni-apis", @@ -128,7 +128,7 @@ "install-drivers": null }, "ni.protobuf.types": { - "package-basepath": "./packages", + "package-basepath": "packages", "proto-basepath": "./third_party/ni-apis", "proto-subpath": "ni/protobuf/types", "proto-include-path": "./third_party/ni-apis", From 9a89e523615cba3b90cae0ddf9173e9bc2a506da Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:37:50 -0700 Subject: [PATCH 16/24] Use the default working directory to upload docs Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index f8016cd3..3efb6ae8 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -45,4 +45,4 @@ jobs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ inputs.package-name }}-docs - path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/docs/_build/ + path: docs/_build/ From 3b6cfd57e577b292d373b06d557336c98bab55c5 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:46:04 -0700 Subject: [PATCH 17/24] Revert the absolute path input for run_and_upload_unit_tests Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/run_unit_tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_unit_tests.yml b/.github/workflows/run_unit_tests.yml index 6cd7a55e..00d34408 100644 --- a/.github/workflows/run_unit_tests.yml +++ b/.github/workflows/run_unit_tests.yml @@ -61,4 +61,4 @@ jobs: uses: ./.github/actions/run_and_upload_unit_tests with: package-name: grpc_generator - package-basepath: ${{ github.workspace }}/tools + package-basepath: tools From 3da9712c337008d351c53d0050ccf191a55ca1ea Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:55:20 -0700 Subject: [PATCH 18/24] Remove all ./ to build the paths correctly at call sites Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- packages.json | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/packages.json b/packages.json index be15cde6..bb07d3e1 100644 --- a/packages.json +++ b/packages.json @@ -9,9 +9,9 @@ }, "ni.datamonikers.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/datamonikers/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, @@ -25,9 +25,9 @@ }, "ni.grpcdevice.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./proto", + "proto-basepath": "proto", "proto-subpath": ".", - "proto-include-path": "./proto", + "proto-include-path": "proto", "output-format": "subpackage", "install-drivers": null }, @@ -41,25 +41,25 @@ }, "ni.measurementlink.discovery.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurementlink/discovery/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, "ni.measurementlink.measurement.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, "ni.measurementlink.measurement.v2.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurementlink/measurement/v2", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, @@ -73,17 +73,17 @@ }, "ni.measurementlink.pinmap.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurementlink/pinmap/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, "ni.measurementlink.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurementlink", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, @@ -97,41 +97,41 @@ }, "ni.measurementlink.sessionmanagement.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurementlink/sessionmanagement/v1", - "proto-include-path": "./third_party/ni-apis/ni/grpcdevice/v1", + "proto-include-path": "third_party/ni-apis/ni/grpcdevice/v1", "output-format": "subpackage", "install-drivers": null }, "ni.measurements.data.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurements/data/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, "ni.measurements.metadata.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/measurements/metadata/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", "install-drivers": null }, "ni.panels.v1.proto": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/panels/v1", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "submodule", "install-drivers": null }, "ni.protobuf.types": { "package-basepath": "packages", - "proto-basepath": "./third_party/ni-apis", + "proto-basepath": "third_party/ni-apis", "proto-subpath": "ni/protobuf/types", - "proto-include-path": "./third_party/ni-apis", + "proto-include-path": "third_party/ni-apis", "output-format": "submodule", "install-drivers": null } From cd7ca0683c424da33679d0337bba6887570d6395 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:09:10 -0700 Subject: [PATCH 19/24] Remove intermediate relative path segments Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_package.yml | 4 ++-- .github/workflows/publish.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 37cf13b3..085a1ae7 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -33,7 +33,7 @@ jobs: uses: ./.github/workflows/check_analyzers.yml with: package-name: ${{ inputs.package-name }} - package-basepath: ./${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} install-drivers: ${{ needs.get_package_info.outputs.install-drivers == 'true' }} check_docs: if: ${{ needs.get_package_info.outputs.should-check-docs == 'true' }} @@ -42,4 +42,4 @@ jobs: uses: ./.github/workflows/check_docs.yml with: package-name: ${{ inputs.package-name }} - package-basepath: ./${{ needs.get_package_info.outputs.package-basepath }} + package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8036fb37..d33124cd 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -102,7 +102,7 @@ jobs: expected-version: ${{ needs.get_package_info.outputs.package-version }} - name: Build distribution packages run: poetry build - working-directory: ${{ github.workspace }}//packages/${{ needs.get_package_info.outputs.package-name }} + working-directory: ${{ github.workspace }}/packages/${{ needs.get_package_info.outputs.package-name }} - name: Upload build artifacts uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: From f1c7c9822e024b77ef41dbe1edca505baf01dd1a Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:16:56 -0700 Subject: [PATCH 20/24] Use absolute path for upload-artifact because it doesn't use default working-directory Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index 3efb6ae8..f8016cd3 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -45,4 +45,4 @@ jobs: uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ inputs.package-name }}-docs - path: docs/_build/ + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/docs/_build/ From 5e8fc02e34a5559b9b4ab2020bac41d17d0da7f7 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Fri, 5 Sep 2025 15:34:52 -0700 Subject: [PATCH 21/24] Use absolute path for Python venv cache because the action does not use the default working directory Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_analyzers.yml | 2 +- .github/workflows/check_codegen.yml | 2 +- .github/workflows/check_docs.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index 3780d5d8..978a580f 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -42,7 +42,7 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: .venv + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: | diff --git a/.github/workflows/check_codegen.yml b/.github/workflows/check_codegen.yml index b655cf55..d2026807 100644 --- a/.github/workflows/check_codegen.yml +++ b/.github/workflows/check_codegen.yml @@ -58,7 +58,7 @@ jobs: - name: Cache virtualenv uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: .venv + path: ${{ github.workspace }}/tools/grpc_generator/.venv key: grpc_generator-only-main-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('tools/grpc_generator/poetry.lock') }} - name: Install grpc_generator run: poetry install -v --only main diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index f8016cd3..24e2d9ae 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -35,7 +35,7 @@ jobs: - name: Cache virtualenv (with docs) uses: actions/cache@0400d5f644dc74513175e3cd8d07132dd4860809 # v4.2.4 with: - path: .venv + path: ${{ github.workspace }}/${{ inputs.package-basepath }}/${{ inputs.package-name }}/.venv key: ${{ inputs.package-name }}-with-docs-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install nitypes (with docs) run: poetry install -v --only main,docs From 9e2fa283f2ddcbbf99815cbcd393f4a56b34fcfd Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Mon, 8 Sep 2025 09:51:40 -0700 Subject: [PATCH 22/24] Update documentation and defaults in workflow files Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_analyzers.yml | 4 ++-- .github/workflows/check_codegen.yml | 14 +++++++------- .github/workflows/check_docs.yml | 4 ++-- .github/workflows/check_package.yml | 2 +- .github/workflows/get_package_info.yml | 2 +- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index 978a580f..26982d86 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -4,12 +4,12 @@ on: workflow_call: inputs: package-name: - description: 'The name of the package to check.' + description: 'The name of the package folder to check.' default: '' required: true type: string package-basepath: - description: 'The parent directory of the package to check. Defaults to packages.' + description: 'The base path of the package to check, relative to the repo root.' default: '' required: true type: string diff --git a/.github/workflows/check_codegen.yml b/.github/workflows/check_codegen.yml index d2026807..7e63761a 100644 --- a/.github/workflows/check_codegen.yml +++ b/.github/workflows/check_codegen.yml @@ -4,25 +4,25 @@ on: workflow_call: inputs: package-name: - description: 'The name of the package to check.' + description: 'The name of the package folder to check.' default: '' required: true type: string proto-basepath: - description: 'The base path for proto files used for generation.' - default: './third_party/ni-apis' + description: 'The base path to the proto files used for generation.' + default: 'third_party/ni-apis' type: string proto-subpath: - description: 'The path to proto files relative to proto-base-path.' + description: 'The specific subpath to the proto files needed for generation, relative to the proto-basepath.' default: '' required: true type: string proto-include-path: - description: 'Additional path to include in the proto generation.' - default: './third_party/ni-apis' + description: 'Additional path to include during proto generation.' + default: 'third_party/ni-apis' type: string output-basepath: - description: 'The base output path for codegened files.' + description: 'The base output path for the generated files.' default: '' required: true type: string diff --git a/.github/workflows/check_docs.yml b/.github/workflows/check_docs.yml index 24e2d9ae..d397d1fa 100644 --- a/.github/workflows/check_docs.yml +++ b/.github/workflows/check_docs.yml @@ -4,12 +4,12 @@ on: workflow_call: inputs: package-name: - description: 'The name of the package to check.' + description: 'The name of the package folder to check.' default: '' required: true type: string package-basepath: - description: 'The parent directory of the package.' + description: 'The base path of the package to check, relative to the repo root.' default: '' required: true type: string diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 085a1ae7..0988b425 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: package-name: - description: 'The name of the package to check.' + description: 'The name of the package folder to check.' default: '' required: true type: string diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index dedb785b..97575936 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -4,7 +4,7 @@ on: workflow_call: inputs: package-name: - description: 'The name of the package to check.' + description: 'The name of the package from packages.json.' default: '' required: true type: string From 4766a830ff510d72a5fe214c14f43166d5fb1559 Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:24:51 -0700 Subject: [PATCH 23/24] Only leaf workflows should use the repo root for their step inputs Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_codegen.yml | 6 +++--- .github/workflows/check_package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/check_codegen.yml b/.github/workflows/check_codegen.yml index 7e63761a..83ee069f 100644 --- a/.github/workflows/check_codegen.yml +++ b/.github/workflows/check_codegen.yml @@ -9,7 +9,7 @@ on: required: true type: string proto-basepath: - description: 'The base path to the proto files used for generation.' + description: 'The base path to the proto files used for generation, relative to the repo root.' default: 'third_party/ni-apis' type: string proto-subpath: @@ -18,11 +18,11 @@ on: required: true type: string proto-include-path: - description: 'Additional path to include during proto generation.' + description: 'Additional path to include during proto generation, relative to the repo root.' default: 'third_party/ni-apis' type: string output-basepath: - description: 'The base output path for the generated files.' + description: 'The base output path for the generated files, relative to the repo root.' default: '' required: true type: string diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 0988b425..7716d17d 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -22,10 +22,10 @@ jobs: uses: ./.github/workflows/check_codegen.yml with: package-name: ${{ inputs.package-name }} - proto-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.proto-basepath }} + proto-basepath: ${{ needs.get_package_info.outputs.proto-basepath }} proto-subpath: ${{ needs.get_package_info.outputs.proto-subpath }} - proto-include-path: ${{ github.workspace }}/${{ needs.get_package_info.outputs.proto-include-path }} - output-basepath: ${{ github.workspace }}/${{ needs.get_package_info.outputs.package-basepath }}/${{ inputs.package-name }}/src + proto-include-path: ${{ needs.get_package_info.outputs.proto-include-path }} + output-basepath: ${{ needs.get_package_info.outputs.package-basepath }}/${{ inputs.package-name }}/src output-format: ${{ needs.get_package_info.outputs.output-format }} check_analyzers: name: Check analyzers for ${{ inputs.package-name }} From ea547b3723923f6e1e3eec384167209b9dcedcaa Mon Sep 17 00:00:00 2001 From: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> Date: Mon, 8 Sep 2025 10:35:02 -0700 Subject: [PATCH 24/24] Generalize check_analyzers and change 'install-drivers' to 'install-extras' Signed-off-by: Joe Friedrichsen <114173023+jfriedri-ni@users.noreply.github.com> --- .github/workflows/check_analyzers.yml | 12 ++++---- .github/workflows/check_package.yml | 2 +- .github/workflows/get_package_info.yml | 41 +++++++++++++------------- packages.json | 34 ++++++++++----------- 4 files changed, 45 insertions(+), 44 deletions(-) diff --git a/.github/workflows/check_analyzers.yml b/.github/workflows/check_analyzers.yml index a91787f6..2b855913 100644 --- a/.github/workflows/check_analyzers.yml +++ b/.github/workflows/check_analyzers.yml @@ -13,11 +13,11 @@ on: default: '' required: true type: string - install-drivers: - description: 'Whether to install drivers extras' - default: false + install-extras: + description: 'A space-separated list of package extras to install.' + default: '' required: false - type: boolean + type: string jobs: check_analyzers: @@ -46,8 +46,8 @@ jobs: key: ${{ inputs.package-name }}-${{ runner.os }}-py${{ steps.setup-python.outputs.python-version }}-${{ hashFiles(format('{0}/{1}/poetry.lock', inputs.package-basepath, inputs.package-name)) }} - name: Install ${{ inputs.package-name }} run: | - if [ "${{ inputs.install-drivers }}" = "true" ]; then - poetry install -v --extras drivers + if [ -n "${{ inputs.install-extras }}" ]; then + poetry install -v --extras '${{ inputs.install-extras }}' else poetry install -v fi diff --git a/.github/workflows/check_package.yml b/.github/workflows/check_package.yml index 7716d17d..a844720f 100644 --- a/.github/workflows/check_package.yml +++ b/.github/workflows/check_package.yml @@ -34,7 +34,7 @@ jobs: with: package-name: ${{ inputs.package-name }} package-basepath: ${{ needs.get_package_info.outputs.package-basepath }} - install-drivers: ${{ needs.get_package_info.outputs.install-drivers == 'true' }} + install-extras: ${{ needs.get_package_info.outputs.install-extras }} check_docs: if: ${{ needs.get_package_info.outputs.should-check-docs == 'true' }} name: Check docs for ${{ inputs.package-name }} diff --git a/.github/workflows/get_package_info.yml b/.github/workflows/get_package_info.yml index 97575936..fedb5d75 100644 --- a/.github/workflows/get_package_info.yml +++ b/.github/workflows/get_package_info.yml @@ -10,31 +10,31 @@ on: type: string outputs: package-basepath: - description: 'The parent directory of the package.' + description: 'The path to the parent directory of the package, relative to the repo root.' value: ${{ jobs.get_package_info.outputs.package-basepath }} proto-basepath: - description: 'Base path for proto files.' + description: 'The base path to the proto files used for generation.' value: ${{ jobs.get_package_info.outputs.proto-basepath }} proto-subpath: - description: 'Subpath for proto files.' + description: 'The specific subpath to the proto files needed for generation, relative to the proto-basepath.' value: ${{ jobs.get_package_info.outputs.proto-subpath }} proto-include-path: - description: 'Include path for proto files.' + description: 'Additional path to include during proto generation.' value: ${{ jobs.get_package_info.outputs.proto-include-path }} output-format: - description: 'Output format.' + description: 'The format for the generated stubs. Options are submodule and subpackage.' value: ${{ jobs.get_package_info.outputs.output-format }} - install-drivers: - description: 'Whether to install drivers extra' - value: ${{ jobs.get_package_info.outputs.install-drivers }} + install-extras: + description: 'A space-separated list of package extras to install.' + value: ${{ jobs.get_package_info.outputs.install-extras }} should-check-codegen: - description: 'Whether to check protobuf code generation' + description: 'Whether to check protobuf code generation.' value: ${{ jobs.get_package_info.outputs.should-check-codegen }} should-check-docs: - description: 'Whether to check documentation generation' + description: 'Whether to check documentation generation.' value: ${{ jobs.get_package_info.outputs.should-check-docs }} should-run-tests: - description: 'Whether to run automated tests' + description: 'Whether to run automated tests.' value: ${{ jobs.get_package_info.outputs.should-run-tests }} jobs: @@ -47,7 +47,7 @@ jobs: proto-subpath: ${{ steps.parse_json.outputs.proto-subpath }} proto-include-path: ${{ steps.parse_json.outputs.proto-include-path }} output-format: ${{ steps.parse_json.outputs.output-format }} - install-drivers: ${{ steps.parse_json.outputs.install-drivers }} + install-extras: ${{ steps.parse_json.outputs.install-extras }} should-check-codegen: ${{ steps.parse_json.outputs.should-check-codegen }} should-check-docs: ${{ steps.parse_json.outputs.should-check-docs }} should-run-tests: ${{ steps.parse_json.outputs.should-run-tests }} @@ -69,32 +69,33 @@ jobs: proto_subpath=$(echo $info | jq -r '."proto-subpath"') proto_include_path=$(echo $info | jq -r '."proto-include-path"') output_format=$(echo $info | jq -r '."output-format"') - install_drivers=$(echo $info | jq -r '."install-drivers"') + install_extras=$(echo $info | jq -r '."install-extras"') should_check_codegen=false - if [ "${proto_subpath}" != "null" ] - then + if [ "${proto_subpath}" != "null" ]; then should_check_codegen=true fi should_check_docs=false - if [ -d "${GITHUB_WORKSPACE}/${package_basepath}/${{ inputs.package-name }}/docs" ] - then + if [ -d "${GITHUB_WORKSPACE}/${package_basepath}/${{ inputs.package-name }}/docs" ]; then should_check_docs=true fi should_run_tests=false - if [ -d "${GITHUB_WORKSPACE}/${package_basepath}/${{ inputs.package-name }}/tests" ] - then + if [ -d "${GITHUB_WORKSPACE}/${package_basepath}/${{ inputs.package-name }}/tests" ]; then should_run_tests=true fi + if [ "${install_extras}" == "null" ]; then + install_extras="" + fi + echo "package-basepath=${package_basepath}" >> $GITHUB_OUTPUT echo "proto-basepath="${proto_basepath} >> $GITHUB_OUTPUT echo "proto-subpath=${proto_subpath}" >> $GITHUB_OUTPUT echo "proto-include-path=${proto_include_path}" >> $GITHUB_OUTPUT echo "output-format=${output_format}" >> $GITHUB_OUTPUT - echo "install-drivers=${install_drivers}" >> $GITHUB_OUTPUT + echo "install-extras=${install_extras}" >> $GITHUB_OUTPUT echo "should-check-codegen=${should_check_codegen}" >> $GITHUB_OUTPUT echo "should-check-docs=${should_check_docs}" >> $GITHUB_OUTPUT echo "should-run-tests=${should_run_tests}" >> $GITHUB_OUTPUT diff --git a/packages.json b/packages.json index bb07d3e1..34543d2d 100644 --- a/packages.json +++ b/packages.json @@ -5,7 +5,7 @@ "proto-subpath": null, "proto-include-path": null, "output-format": null, - "install-drivers": null + "install-extras": null }, "ni.datamonikers.v1.proto": { "package-basepath": "packages", @@ -13,7 +13,7 @@ "proto-subpath": "ni/datamonikers/v1", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni-grpc-extensions" : { "package-basepath": "packages", @@ -21,7 +21,7 @@ "proto-subpath": null, "proto-include-path": null, "output-format": null, - "install-drivers": null + "install-extras": null }, "ni.grpcdevice.v1.proto": { "package-basepath": "packages", @@ -29,7 +29,7 @@ "proto-subpath": ".", "proto-include-path": "proto", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurementlink.discovery.v1.client": { "package-basepath": "packages", @@ -37,7 +37,7 @@ "proto-subpath": null, "proto-include-path": null, "output-format": null, - "install-drivers": null + "install-extras": null }, "ni.measurementlink.discovery.v1.proto": { "package-basepath": "packages", @@ -45,7 +45,7 @@ "proto-subpath": "ni/measurementlink/discovery/v1", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurementlink.measurement.v1.proto": { "package-basepath": "packages", @@ -53,7 +53,7 @@ "proto-subpath": "ni/measurementlink/measurement/v1", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurementlink.measurement.v2.proto": { "package-basepath": "packages", @@ -61,7 +61,7 @@ "proto-subpath": "ni/measurementlink/measurement/v2", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurementlink.pinmap.v1.client": { "package-basepath": "packages", @@ -69,7 +69,7 @@ "proto-subpath": null, "proto-include-path": null, "output-format": null, - "install-drivers": null + "install-extras": null }, "ni.measurementlink.pinmap.v1.proto": { "package-basepath": "packages", @@ -77,7 +77,7 @@ "proto-subpath": "ni/measurementlink/pinmap/v1", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurementlink.proto": { "package-basepath": "packages", @@ -85,7 +85,7 @@ "proto-subpath": "ni/measurementlink", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurementlink.sessionmanagement.v1.client": { "package-basepath": "packages", @@ -93,7 +93,7 @@ "proto-subpath": null, "proto-include-path": null, "output-format": null, - "install-drivers": true + "install-extras": "drivers" }, "ni.measurementlink.sessionmanagement.v1.proto": { "package-basepath": "packages", @@ -101,7 +101,7 @@ "proto-subpath": "ni/measurementlink/sessionmanagement/v1", "proto-include-path": "third_party/ni-apis/ni/grpcdevice/v1", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurements.data.v1.proto": { "package-basepath": "packages", @@ -109,7 +109,7 @@ "proto-subpath": "ni/measurements/data/v1", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.measurements.metadata.v1.proto": { "package-basepath": "packages", @@ -117,7 +117,7 @@ "proto-subpath": "ni/measurements/metadata/v1", "proto-include-path": "third_party/ni-apis", "output-format": "subpackage", - "install-drivers": null + "install-extras": null }, "ni.panels.v1.proto": { "package-basepath": "packages", @@ -125,7 +125,7 @@ "proto-subpath": "ni/panels/v1", "proto-include-path": "third_party/ni-apis", "output-format": "submodule", - "install-drivers": null + "install-extras": null }, "ni.protobuf.types": { "package-basepath": "packages", @@ -133,6 +133,6 @@ "proto-subpath": "ni/protobuf/types", "proto-include-path": "third_party/ni-apis", "output-format": "submodule", - "install-drivers": null + "install-extras": null } }