diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..c9f95c5 --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,48 @@ +name: build and test + +on: + push: + pull_request: + branches: [ main ] + +jobs: + build-and-test: + name: build-and-test-${{matrix.os}} + runs-on: ${{ matrix.os }} + if: github.repository_owner == 'SubnauticaNitrox' + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + + env: + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true + NUGET_PACKAGES: ${{ github.workspace }}/.nuget/package + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Install BinaryPack Dependencies + run: dotnet restore ./src/BinaryPack/BinaryPack.csproj + + - name: Install BinaryPack.Unit Dependencies + run: dotnet restore ./unit/BinaryPack.Unit/BinaryPack.Unit.csproj + + - name: Install BinaryPack.Unit.Internals Dependencies + run: dotnet restore ./unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj + + - name: Build BinaryPack + run: dotnet build ./src/BinaryPack/BinaryPack.csproj --configuration Release --no-restore + + - name: Build BinaryPack.Unit + run: dotnet build ./unit/BinaryPack.Unit/BinaryPack.Unit.csproj --configuration Debug --no-restore + + - name: Build BinaryPack.Unit.Internals + run: dotnet build ./unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj --configuration Debug --no-restore + + - name: Test BinaryPack.Unit + run: dotnet test ./unit/BinaryPack.Unit/BinaryPack.Unit.csproj --no-restore --no-build --verbosity normal + + - name: Test BinaryPack.Unit.Internals + run: dotnet test ./unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj --no-restore --no-build --verbosity normal \ No newline at end of file diff --git a/README.md b/README.md index 74cf962..bf195e1 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,7 @@ # Nitrox BinaryPack +[![build and test](https://github.com/SubnauticaNitrox/BinaryPack/actions/workflows/build-and-test.yml/badge.svg)](https://github.com/SubnauticaNitrox/BinaryPack/actions/workflows/build-and-test.yml) [![NuGet](https://img.shields.io/nuget/v/Nitrox.BinaryPack.svg)](https://www.nuget.org/packages/Nitrox.BinaryPack/) [![Discord](https://img.shields.io/discord/525437013403631617?logo=discord&logoColor=white)](https://discord.gg/E8B4X9s) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) diff --git a/unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj b/unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj index 0d3f0b8..552c713 100644 --- a/unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj +++ b/unit/BinaryPack.Unit.Internals/BinaryPack.Unit.Internals.csproj @@ -4,14 +4,12 @@ net7 false enable - NU1702;MSB3277 + NU1702;MSB3277 - - - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/unit/BinaryPack.Unit/BinaryPack.Unit.csproj b/unit/BinaryPack.Unit/BinaryPack.Unit.csproj index f514627..2d83ad9 100644 --- a/unit/BinaryPack.Unit/BinaryPack.Unit.csproj +++ b/unit/BinaryPack.Unit/BinaryPack.Unit.csproj @@ -1,19 +1,18 @@ - + - net472;net7 + net472;net7 + net7 latest enable false - NU1702;MSB3277 + NU1702;MSB3277 - - - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive