Skip to content

Commit c285022

Browse files
authored
Merge pull request #19 (Add GitHub Actions CI)
Add GitHub actions CI
2 parents 1586eda + af6e748 commit c285022

File tree

4 files changed

+50
-3
lines changed

4 files changed

+50
-3
lines changed

.github/workflows/dotnet.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: .NET
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ${{ matrix.os }}
13+
14+
strategy:
15+
matrix:
16+
os: [ ubuntu-latest, windows-latest, macos-latest ]
17+
dotnet: [ '6.0', '8.0' ]
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Setup .NET
22+
uses: actions/setup-dotnet@v4
23+
id: stepid
24+
with:
25+
dotnet-version: ${{ matrix.dotnet }}
26+
# By default, tests will be executed under the latest installed version!
27+
- name: Create temporary global.json
28+
run: echo '{"sdk":{"version":"${{steps.stepid.outputs.dotnet-version}}"}}' > ./global.json
29+
- name: Restore packages
30+
run: dotnet restore -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"
31+
- name: Build solution
32+
run: dotnet build --no-restore --configuration Release -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest" --verbosity normal
33+
- name: Run tests
34+
run: dotnet test --configuration Release --no-build --verbosity normal -p:TargetFrameworks="net${{ matrix.dotnet }}" -p:LangVersion="latest"

SqliteCache.AspNetCore/SqliteCache.AspNetCore.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<AssemblyName>NeoSmart.Caching.Sqlite.AspNetCore</AssemblyName>
55
<RootNamespace>NeoSmart.Caching.Sqlite.AspNetCore</RootNamespace>
6-
<TargetFramework>netstandard2.1</TargetFramework>
6+
<TargetFrameworks>netstandard2.1</TargetFrameworks>
77
<Nullable>enable</Nullable>
88
<LangVersion>11</LangVersion>
99
<Version>8.0.0</Version>

SqliteCache.Tests/SqliteCache.Tests.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>net462;netcoreapp3.1;net5.0;net6.0;net8.0</TargetFrameworks>
54
<LangVersion>preview</LangVersion>
65
<IsPackable>false</IsPackable>
76
<AssemblyName>NeoSmart.Caching.Sqlite.Tests</AssemblyName>
87
<RootNamespace>NeoSmart.Caching.Sqlite.Tests</RootNamespace>
98
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
109
</PropertyGroup>
1110

11+
<!-- Only test net462 if we are building under Windows -->
12+
<PropertyGroup Condition="'$(OS)' == 'Windows_NT'">
13+
<TargetFrameworks>
14+
net462;net6.0;net8.0
15+
</TargetFrameworks>
16+
</PropertyGroup>
17+
18+
<PropertyGroup Condition="'$(OS)' != 'Windows_NT'">
19+
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
20+
</PropertyGroup>
21+
1222
<ItemGroup>
1323
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
1424
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
@@ -30,3 +40,5 @@
3040
</ItemGroup>
3141

3242
</Project>
43+
44+
<!-- vim: set sw=2 : -->

SqliteCache/SqliteCache.csproj

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

33
<PropertyGroup>
4-
<TargetFrameworks>netstandard2.0;netcoreapp3.1;net5.0;net6.0;net8.0</TargetFrameworks>
4+
<!-- Upstream dependencies have removed support for net5.0 and lower -->
5+
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
56
<LangVersion>9.0</LangVersion>
67
<AssemblyName>NeoSmart.Caching.Sqlite</AssemblyName>
78
<RootNamespace>NeoSmart.Caching.Sqlite</RootNamespace>

0 commit comments

Comments
 (0)