Skip to content

Commit

Permalink
Upgrade the projects to use .NET 8 and C# 12 (#230)
Browse files Browse the repository at this point in the history
* Upgrade the projects to use .NET 8 and C# 12

* updated the actions

* Update codeql-analysis.yml

* self

* self

* Update README.md

* Update README.md

* self

* updated nunit version

* Updated GH actions

* updated nuget

* CR

* self
  • Loading branch information
abdallahbeshi authored Jan 29, 2024
1 parent faca6f4 commit 58cc774
Show file tree
Hide file tree
Showing 50 changed files with 232 additions and 224 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Clean
run: dotnet clean ./Mews.Fiscalizations.All.sln --configuration Release && dotnet nuget locals all --clear
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ jobs:
language: [ 'csharp' ]
steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
8 changes: 4 additions & 4 deletions .github/workflows/publish-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-austria.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-basque.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-germany.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-hungary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-italy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-spain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup .NET 6
uses: actions/setup-dotnet@v3
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.0.x
dotnet-version: 8.x

- name: Install dependencies
run: dotnet restore
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@

## 📃 Description

This repository contains multiple projects. Each project supports reporting of e-invoices to the corresponding country's government authority. Each project folder has it's own documentation. Use the link in the table below to get there.
This repository contains multiple projects. Each project supports reporting of e-invoices to the corresponding country's government authority. Each project folder has its own documentation. Use the link in the table below to get there.

**Please note that we're not responsible for how these libraries are used and if the data provided is correct or not.**
**Please note that we're not responsible for how these libraries are used and whether the data provided is correct or not.**
**Also, it is important to note that these libraries were created to meet our usages, so they might be missing some data that can be important in your case (feel free to extend any library and create a PR).**

## ⚙️ Installation

For the reporting of e-invoices to a specifc authority, install the package that corresponds to that country through NuGet or using the following commands.
For the reporting of e-invoices to a specific authority, install the package that corresponds to that country through NuGet or by using the following commands.

For example, installing the Spanish fiscalization package in order to report invoices to the Spanish authorities (SII).
```bash
Expand All @@ -33,14 +33,14 @@ Install-Package Mews.Fiscalizations.All

## 🎯 Features

- Functional approach via [FuncSharp](https://github.com/siroky/FuncSharp). Definitely check-out the examples of usage, so you're not surprised. At the very least IOptions and ITries.
- Functional approach via [FuncSharp](https://github.com/MewsSystems/FuncSharp). Definitely check out the examples of usage, so you're not surprised. At the very least IOptions and ITries.
- Early data validation.
- Asynchronous I/O.
- All endpoints are covered with tests.
- Intuitive immutable DTOs.
- Pipelines that run on both Windows and Linux operating systems.
- Code examples for each project.
- Cross platform (uses .NET 6).
- Cross-platform (uses .NET 8).
- 6 countries + Basque region supported.
- Logging support for some fiscalizations.

Expand Down Expand Up @@ -75,12 +75,12 @@ Please visit the desired fiscalization project to see its code examples.

## 👍 Contribute

If you want to support the development of `Mews.Fiscalizations`, feel free to create a PR with a clear description on what was fixed or introduced.
If you want to support the development of `Mews.Fiscalizations`, feel free to create a PR with a clear description of what was fixed or introduced.
Also, please make sure to introduce tests when applicable.

## ☕ Donate

There is no need to donate the project, but thanks for considering it! Instead, if you like the project, star it here on GitHub :-) Thanks!
There is no need to donate to the project, but thanks for considering it! Instead, if you like the project, star it here on GitHub :-) Thanks!

If you still insist on donating, we accept gummy bears at Mews Systems s.r.o., Náměstí IP Pavlova 5, Vinohrady 120 00 Prague. This project was, of course, powered by a huge pile of gummy bears ;-)

Expand All @@ -90,7 +90,7 @@ We’re building transformational technology for millions of hospitality profess

**Hoteliers**

The hoteliers who choose Mews share our passion for innovation and they don’t accept the status quo. They’re using our technology to rethink physical spaces, services and guest experiences.
The hoteliers who choose Mews share our passion for innovation and they don’t accept the status quo. They’re using our technology to rethink physical spaces, services, and guest experiences.

**Guests**

Expand Down
24 changes: 12 additions & 12 deletions src/Austria/Mews.Fiscalizations.Austria.Tests/ATrustSignerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ public async Task ATrustSignerWorks()
created: new LocalDateTime(new DateTime(2015, 11, 25, 19, 20, 11), austrianTimeZone)
)
));
Assert.IsNotNull(result);
Assert.IsNotNull(result.JwsRepresentation);
Assert.IsNotNull(result.SignedQrData);
Assert.IsNotEmpty(result.JwsRepresentation.Value);
Assert.IsNotEmpty(result.JwsRepresentation.Signature.Value);
Assert.IsNotEmpty(result.SignedQrData.Value);
Assert.IsNotEmpty(result.SignedQrData.Data.Value);
Assert.That(result, Is.Not.Null);
Assert.That(result.JwsRepresentation, Is.Not.Null);
Assert.That(result.SignedQrData, Is.Not.Null);
Assert.That(result.JwsRepresentation.Value, Is.Not.Null);
Assert.That(result.JwsRepresentation.Signature.Value, Is.Not.Null);
Assert.That(result.SignedQrData.Value, Is.Not.Null);
Assert.That(result.SignedQrData.Data.Value, Is.Not.Null);
}

[Test]
public async Task GetCertificateInfoWorks()
{
var info = await new ATrustSigner(Credentials, ATrustEnvironment.Test).GetCertificateInfoAsync();
Assert.IsNotNull(info);
Assert.IsNotEmpty(info.Certificate);
Assert.IsNotEmpty(info.CertificateSerialNumber);
Assert.IsNotEmpty(info.Algorithm);
Assert.IsNotEmpty(info.CertificateSerialNumberHex);
Assert.That(info, Is.Not.Null);
Assert.That(info.Certificate, Is.Not.Null);
Assert.That(info.CertificateSerialNumber, Is.Not.Null);
Assert.That(info.Algorithm, Is.Not.Null);
Assert.That(info.CertificateSerialNumberHex, Is.Not.Null);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Mews.Fiscalizations.All.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
<LangVersion>12</LangVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.3" />
<PackageReference Include="nunit" Version="3.13.3" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="TimeZoneConverter" Version="6.1.0" />
</ItemGroup>
Expand Down
14 changes: 7 additions & 7 deletions src/Austria/Mews.Fiscalizations.Austria.Tests/OfflineTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public async Task OfflineSignatureWorks()
created: new LocalDateTime( new DateTime(year: 2015, month: 11, day: 25, hour: 19, minute: 20, second: 11), austrianTimeZone)
)
));
Assert.IsNotNull(result);
Assert.IsNotNull(result.JwsRepresentation);
Assert.IsNotNull(result.SignedQrData);
Assert.IsNotEmpty(result.JwsRepresentation.Value);
Assert.IsNotEmpty(result.JwsRepresentation.Signature.Value);
Assert.IsNotEmpty(result.SignedQrData.Value);
Assert.IsNotEmpty(result.SignedQrData.Data.Value);
Assert.That(result, Is.Not.Null);
Assert.That(result.JwsRepresentation, Is.Not.Null);
Assert.That(result.SignedQrData, Is.Not.Null);
Assert.That(result.JwsRepresentation.Value, Is.Not.Null);
Assert.That(result.JwsRepresentation.Signature.Value, Is.Not.Null);
Assert.That(result.SignedQrData.Value, Is.Not.Null);
Assert.That(result.SignedQrData.Data.Value, Is.Not.Null);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Mews.Fiscalizations.All.props" />
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Authors>Mews</Authors>
<Description>Client for ATrust - Austrian Registrierkassen</Description>
<PackageTags>fiscalization;austria;Registrierkassen</PackageTags>
Expand All @@ -10,15 +10,15 @@
<RepositoryUrl>https://github.com/MewsSystems/fiscalizations</RepositoryUrl>
<Icon>https://raw.githubusercontent.com/msigut/eet/master/receipt.png</Icon>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageVersion>7.0.0</PackageVersion>
<LangVersion>10</LangVersion>
<PackageVersion>8.0.0</PackageVersion>
<LangVersion>12</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BouncyCastle.NetCore" Version="1.9.0" />
<PackageReference Include="BouncyCastle.NetCore" Version="2.2.1" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="6.32.0" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="7.2.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ public void Create_BizkaiaData_JsonSerialization_Succeeds()
Assert.DoesNotThrow(() =>
{
var serializedData = JsonSerializer.Serialize(SampleBizkaiData);
Assert.IsNotEmpty(serializedData);
Assert.AreEqual(serializedData, ExpectedSerializationResult);
Assert.That(serializedData, Is.Not.Empty);
Assert.That(serializedData, Is.EqualTo(ExpectedSerializationResult));
});
}

Expand All @@ -40,10 +40,10 @@ public void Create_BizkaiaData_Json_Serialization_Deserialization_Succeeds()
Assert.DoesNotThrow(() =>
{
var serializedData = JsonSerializer.Serialize(SampleBizkaiData);
Assert.IsNotEmpty(serializedData);
Assert.That(serializedData, Is.Not.Empty);

var deserializedData = JsonSerializer.Deserialize<BizkaiaHeaderData>(serializedData);
Assert.AreEqual(serializedData, JsonSerializer.Serialize(deserializedData));
Assert.That(serializedData, Is.EqualTo(JsonSerializer.Serialize(deserializedData)));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public void CorrectResponse_Generates_CorrectResult()
var response = XmlSerializationHelper.Deserialize<LROEPJ240FacturasEmitidasConSGAltaRespuesta>(CorrectResponseFilename);
var state = DtoToModelConverter.ConvertBizkaiaState(response.Registros.Single().SituacionRegistro.EstadoRegistro);

Assert.AreEqual(state, InvoiceState.Received);
Assert.That(state, Is.EqualTo(InvoiceState.Received));
});
}

Expand All @@ -30,8 +30,8 @@ public void IncorrectResponse_Generates_IncorrectResponse()
var errorCode = DtoToModelConverter.ConvertBizkaiaErrorCodes(response.Registros.Single().SituacionRegistro.CodigoErrorRegistro);
var state = DtoToModelConverter.ConvertBizkaiaState(response.Registros.Single().SituacionRegistro.EstadoRegistro);

Assert.AreEqual(state, InvoiceState.Refused);
Assert.AreEqual(errorCode, ErrorCode.DuplicateInvoice);
Assert.That(state, Is.EqualTo(InvoiceState.Refused));
Assert.That(errorCode, Is.EqualTo(ErrorCode.DuplicateInvoice));
});
}
}
Loading

0 comments on commit 58cc774

Please sign in to comment.