Skip to content

Commit

Permalink
ci(c#): lint c# (#20512)
Browse files Browse the repository at this point in the history
  • Loading branch information
hongbo-miao authored Nov 16, 2024
1 parent 319fed3 commit fbab4a6
Show file tree
Hide file tree
Showing 7 changed files with 48 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
29 changes: 29 additions & 0 deletions .github/workflows/.lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
hm-spark-ingest-from-s3-to-kafka: ${{ steps.filter.outputs.hm-spark-ingest-from-s3-to-kafka }}
mobile-android: ${{ steps.filter.outputs.mobile-android }}
mobile-react-native: ${{ steps.filter.outputs.mobile-react-native }}
national-instruments-veristand-zeromq-bridge: ${{ steps.filter.outputs.national-instruments-veristand-zeromq-bridge }}
kafka-rust-proto-consumer: ${{ steps.filter.outputs.kafka-rust-proto-consumer }}
kafka-rust-proto-producer: ${{ steps.filter.outputs.kafka-rust-proto-producer }}
kafka-rust-udp-kafka-bridge: ${{ steps.filter.outputs.kafka-rust-udp-kafka-bridge }}
Expand Down Expand Up @@ -76,6 +77,9 @@ jobs:
mobile-react-native:
- '.github/workflows/.lint.yml'
- 'mobile/mobile-react-native/**'
national-instruments-veristand-zeromq-bridge:
- '.github/workflows/.lint.yml'
- 'hardware-in-the-loop/national-instruments/veristand-zeromq-bridge/**'
udp-receiver:
- '.github/workflows/.lint.yml'
- 'network-programmability/udp/udp-receiver/**'
Expand Down Expand Up @@ -116,6 +120,31 @@ jobs:
run: |
poetry run poe lint-ansible
lint-csharp-national-instruments-veristand-zeromq-bridge:
name: C# (national-instruments-veristand-zeromq-bridge)
runs-on: ubuntu-22.04
environment: test
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4.2.2
- name: Set up NuGet
uses: nuget/setup-nuget@v2
with:
nuget-version: 6.12.1
- name: Set up .NET Core
uses: actions/setup-dotnet@v4.1.0
with:
global-json-file: hardware-in-the-loop/national-instruments/VeriStandZeroMQBridge/global.json
- name: Install dependencies
working-directory: hardware-in-the-loop/national-instruments/VeriStandZeroMQBridge
run: |
nuget restore VeriStandZeroMQBridge.sln
- name: Lint C#
working-directory: hardware-in-the-loop/national-instruments/VeriStandZeroMQBridge
run: |
dotnet format VeriStandZeroMQBridge.sln --verify-no-changes
lint-c-cpp:
name: C, C++
runs-on: ubuntu-22.04
Expand Down
3 changes: 3 additions & 0 deletions .mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ pull_request_rules:
- or:
- check-success=Lint / Ansible
- check-skipped=Lint / Ansible
- or:
- check-success=Lint / C# (national-instruments-veristand-zeromq-bridge)
- check-skipped=Lint / C# (national-instruments-veristand-zeromq-bridge)
- or:
- check-success=Lint / C, C++
- check-skipped=Lint / C, C++
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
nuget-restore:
nuget restore VeriStandZeroMQBridge.sln

lint-csharp:
dotnet format VeriStandZeroMQBridge.sln --verify-no-changes
lint-csharp-fix:
dotnet format VeriStandZeroMQBridge.sln
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using NetMQ;
using NetMQ;
using NetMQ.Sockets;
using NationalInstruments.VeriStand.ClientAPI;
using System;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Reflection;
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.101",
"quality": "release"
}
}

0 comments on commit fbab4a6

Please sign in to comment.