Skip to content

Commit

Permalink
fix workflow issues
Browse files Browse the repository at this point in the history
  • Loading branch information
wilyle committed Feb 21, 2024
1 parent dca253c commit 7b4632f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 8 deletions.
7 changes: 2 additions & 5 deletions .github/workflows/rust-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,8 @@ jobs:
with:
command: fmt
args: --all -- --check
- name: Run doctest
uses: actions-rs/cargo@v1
with:
command: test
args: --workspace --doc
- name: Run doctests
run: ./tools/run_doctests.sh
- name: Run cargo doc
# This step is required to detect possible errors in docs that are not doctests.
uses: actions-rs/cargo@v1
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/security-audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ jobs:
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
- name: Build Digital Twins Connector
run: ./cloud_connectors/azure/digital_twins_connector/build.sh
- name: Build MQTT Connector's Azure Function
run: dotnet build cloud_connectors/azure/mqtt_connector/azure_function/src/function.csproj
- name: Perform CodeQL Analysis
Expand Down
2 changes: 1 addition & 1 deletion cloud_connectors/azure/mqtt_connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The Azure MQTT Cloud Connector forwards data emitted by Freyja to an Azure Event

![Component Diagram](../../../docs/diagrams/azure_mqtt_cloud_connector.svg)

Note that since this cloud connector interfaces with MQTT, it can be configured for use with any MQTT endpoint, not just the Azure-based solution shown here. The architecture diagram and the setup steps presented in this document provide a sample of a full end-to-end architecture that integrates this connector with a cloud digital twin solution.
Note that since this cloud connector interfaces with MQTT, it can be configured for use with any MQTT endpoint, not only the Azure-based solution shown here. The architecture diagram and the setup steps presented in this document provide a sample of a full end-to-end architecture that integrates this connector with a cloud digital twin solution.

## Prerequisites

Expand Down
25 changes: 25 additions & 0 deletions tools/run_doctests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
# SPDX-License-Identifier: MIT

# Running `cargo test --workspace --doc` will fail if the workspace contains only binary packages.
# Normally doc tests are only supported for library packages and binary packages will be skipped,
# but for some reason if a workspace contains only binary packages then the test command will fail.
# This script runs the test command and suppresses the error caused in this case.
# Unfortunately there are no tools to easily navigate a workspace and filter packages by type,
# so this script works by checking the output of the test command.
# Although this is not robust, it is far simpler than the alternative.
OUTPUT=$(cargo test --workspace --doc 2>&1)
RETURN_CODE=$?

echo $OUTPUT
echo

if [[ $OUTPUT =~ "error: no library targets found in packages" ]]; then
echo "Detected 'no library targets' error, which is being suppressed"
exit 0
else
exit $RETURN_CODE
fi

0 comments on commit 7b4632f

Please sign in to comment.