Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
7e831ec
First attempt at running checks on grpc_generator
jfriedri-ni Sep 3, 2025
cf6b374
Try removing the sub-expression
jfriedri-ni Sep 3, 2025
4cef593
Use format() to build the file path
jfriedri-ni Sep 3, 2025
922ca5e
Try GitHub discussions work around
jfriedri-ni Sep 3, 2025
b2da8bc
Move file-test to check_docs.yml
jfriedri-ni Sep 3, 2025
22ca63f
Try spamming every step with the conditional
jfriedri-ni Sep 3, 2025
acf5b3c
Remove same-dir prefix
jfriedri-ni Sep 4, 2025
b5d38c6
Add package-basepath to outputs
jfriedri-ni Sep 4, 2025
ea14da3
Begin adding more package info key-value pairs
jfriedri-ni Sep 4, 2025
4f03bf8
GITHUB_OUTPUT is not echo-able
jfriedri-ni Sep 4, 2025
587b96a
Dumping the environment does not show the results
jfriedri-ni Sep 4, 2025
352e58d
Separate parsing JSON form setting outputs
jfriedri-ni Sep 4, 2025
ecc6019
Calculate the should_do_something variables
jfriedri-ni Sep 4, 2025
0183970
Forget a 'then'
jfriedri-ni Sep 4, 2025
ea2d7ad
Use the output from the if-tests
jfriedri-ni Sep 4, 2025
95d213d
Debug proto_subpath
jfriedri-ni Sep 4, 2025
f6b3f12
Quote test strings
jfriedri-ni Sep 4, 2025
5ea7661
Exercise using JSON null detection
jfriedri-ni Sep 4, 2025
53005c9
Debug proto_subpath
jfriedri-ni Sep 4, 2025
b656619
jq returns null objects as {null}
jfriedri-ni Sep 4, 2025
830d723
Try null JSON literals
jfriedri-ni Sep 4, 2025
801f440
Use JSON null literals
jfriedri-ni Sep 4, 2025
27b08b6
Use the docs directory to detect documentation artifacts
jfriedri-ni Sep 4, 2025
c406cd1
Use all keys in all JSON objects, update workflow files to use calcul…
jfriedri-ni Sep 4, 2025
ef7266b
Use a string comparison for the output values
jfriedri-ni Sep 4, 2025
53df7fe
Restore './' prefix to minimize diffs with main
jfriedri-ni Sep 4, 2025
2a82272
Let's try a GH emoji
jfriedri-ni Sep 4, 2025
15533c8
Try using quotes to use GH emoji
jfriedri-ni Sep 4, 2025
425e7d4
Select 'basepath' as the spelling
jfriedri-ni Sep 4, 2025
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
12 changes: 3 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
pull-requests: write
12 changes: 6 additions & 6 deletions .github/workflows/check_analyzers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 }}
11 changes: 8 additions & 3 deletions .github/workflows/check_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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/
path: ${{ inputs.package-basepath }}/${{ inputs.package-name }}/docs/_build/
10 changes: 7 additions & 3 deletions .github/workflows/check_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,17 +25,21 @@ 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 }}
needs: get_package_info
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 }}
package-name: ${{ inputs.package-name }}
package-basepath: ${{ needs.get_package_info.outputs.package-basepath }}
58 changes: 53 additions & 5 deletions .github/workflows/get_package_info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
Expand All @@ -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
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) }}"
81 changes: 62 additions & 19 deletions packages.json
Original file line number Diff line number Diff line change
@@ -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
}
}
}
Loading