Skip to content

Commit 07a0fb8

Browse files
committed
Changes in Workflows and upgraded Test Project to .NET 8.
1 parent 3cfa658 commit 07a0fb8

File tree

3 files changed

+39
-5
lines changed

3 files changed

+39
-5
lines changed

.github/workflows/dotnet.yml

Lines changed: 37 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,22 +9,56 @@ on:
99
jobs:
1010
build:
1111

12-
runs-on: ubuntu-latest
12+
runs-on: windows-latest
1313

1414
strategy:
1515
matrix:
16-
dotnet: [ '6.0.x', '8.0.x' ]
16+
dotnet: [ '8.0.x' ]
1717
name: .NET ${{ matrix.dotnet }}
1818

1919
steps:
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: 17
24+
distribution: 'zulu' # Alternative distribution options are available.
2025
- uses: actions/checkout@v4
2126
- name: Setup .NET
2227
uses: actions/setup-dotnet@v3
2328
with:
2429
dotnet-version: ${{ matrix.dotnet }}
30+
- name: Cache SonarQube Cloud packages
31+
uses: actions/cache@v4
32+
with:
33+
path: ~\sonar\cache
34+
key: ${{ runner.os }}-sonar
35+
restore-keys: ${{ runner.os }}-sonar
36+
- name: Cache SonarQube Cloud scanner
37+
id: cache-sonar-scanner
38+
uses: actions/cache@v4
39+
with:
40+
path: .\.sonar\scanner
41+
key: ${{ runner.os }}-sonar-scanner
42+
restore-keys: ${{ runner.os }}-sonar-scanner
43+
- name: Install SonarQube Cloud scanner
44+
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
45+
shell: powershell
46+
run: |
47+
New-Item -Path .\.sonar\scanner -ItemType Directory
48+
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
2549
- name: Restore dependencies
2650
run: dotnet restore
51+
- name: SonarCloudPrepare
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
54+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
55+
run: .\.sonar\scanner\dotnet-sonarscanner begin /k:"TensionDev_AutomaticIdentificationSystem" /o:"tensiondev" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.scanner.scanAll=false /d:sonar.cs.opencover.reportsPaths=**/coverage.opencover.xml
2756
- name: Build
2857
run: dotnet build --no-restore
2958
- name: Test
30-
run: dotnet test --no-build --verbosity normal
59+
run: dotnet test --no-build --verbosity normal --collect "XPlat Code Coverage;Format=opencover"
60+
- name: SonarCloudAnalyze
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
63+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
64+
run: .\.sonar\scanner\dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"

AIS/AIS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<Company>TensionDev</Company>
1313
<Product>TensionDev.Maritime.AIS</Product>
1414
<Description>A project to encode and decode known AIS messages.</Description>
15-
<Copyright>Copyright (c) TensionDev 2021 - 2022</Copyright>
15+
<Copyright>Copyright (c) TensionDev 2021</Copyright>
1616
<PackageLicenseExpression>GPL-3.0-or-later</PackageLicenseExpression>
1717
<PackageProjectUrl>https://github.com/TensionDev/AutomaticIdentificationSystem</PackageProjectUrl>
1818
<RepositoryUrl>https://github.com/TensionDev/AutomaticIdentificationSystem</RepositoryUrl>

XUnitTestProjectAIS/XUnitTestProjectAIS.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>net6.0</TargetFramework>
4+
<TargetFramework>net8.0</TargetFramework>
55

66
<IsPackable>false</IsPackable>
77
</PropertyGroup>

0 commit comments

Comments
 (0)