Skip to content

Commit

Permalink
Merge pull request #19 (Add GitHub Actions CI)
Browse files Browse the repository at this point in the history
Add GitHub actions CI
  • Loading branch information
mqudsi authored Mar 2, 2024
2 parents 1586eda + af6e748 commit c285022
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: .NET

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

jobs:
build:

runs-on: ${{ matrix.os }}

strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macos-latest ]
dotnet: [ '6.0', '8.0' ]

steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
id: stepid
with:
dotnet-version: ${{ matrix.dotnet }}
# By default, tests will be executed under the latest installed version!
- name: Create temporary global.json
run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
- name: Restore packages
run: dotnet restore -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"
- name: Build solution
run: dotnet build --no-restore --configuration Release -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest" --verbosity normal
- name: Run tests
run: dotnet test --configuration Release --no-build --verbosity normal -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"
2 changes: 1 addition & 1 deletion SqliteCache.AspNetCore/SqliteCache.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<AssemblyName>NeoSmart.Caching.Sqlite.AspNetCore</AssemblyName>
<RootNamespace>NeoSmart.Caching.Sqlite.AspNetCore</RootNamespace>
<TargetFramework>netstandard2.1</TargetFramework>
<TargetFrameworks>netstandard2.1</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>11</LangVersion>
<Version>8.0.0</Version>
Expand Down
14 changes: 13 additions & 1 deletion SqliteCache.Tests/SqliteCache.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,14 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net462;netcoreapp3.1;net5.0;net6.0;net8.0</TargetFrameworks>
<LangVersion>preview</LangVersion>
<IsPackable>false</IsPackable>
<AssemblyName>NeoSmart.Caching.Sqlite.Tests</AssemblyName>
<RootNamespace>NeoSmart.Caching.Sqlite.Tests</RootNamespace>
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
</PropertyGroup>

<!-- Only test net462 if we are building under Windows -->
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
<TargetFrameworks>
net462;net6.0;net8.0
</TargetFrameworks>
</PropertyGroup>

<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
Expand All @@ -30,3 +40,5 @@
</ItemGroup>

</Project>

<!-- vim: set sw=2 : -->
3 changes: 2 additions & 1 deletion SqliteCache/SqliteCache.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0;net8.0</TargetFrameworks>
<!-- Upstream dependencies have removed support for net5.0 and lower -->
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<AssemblyName>NeoSmart.Caching.Sqlite</AssemblyName>
<RootNamespace>NeoSmart.Caching.Sqlite</RootNamespace>
Expand Down

0 comments on commit c285022

Please sign in to comment.