Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update MsgPack.Light & CI #159

Merged
merged 1 commit into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .azure/build.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .azure/test.yml

This file was deleted.

25 changes: 0 additions & 25 deletions .azure/tests.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Build, Test & Publish nuget

on:
push:
branches: [ "master" ]
tags: ['*']
pull_request:
types: [ opened, synchronize ]
branches: [ "master" ]

env:
NuGetDirectory: ${{ github.workspace }}/nuget

jobs:
build_test_and_pack:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Fetches entire history, so we can analyze commits since last tag
- name: Setup .net core
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
3.1.x
6.0.x

- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore

- name: Docker build
run: docker-compose build

- name: Docker pull
run: docker-compose pull

- name: Docker-compose run
run: docker-compose up -d

- name: Tests
run: dotnet test -c Release --no-build --verbosity normal

- name: Pack nuget
if: success()
run: |
set +x
NUGET_VERSION=$(git describe --tags --abbrev=1 | sed 's/-/./')
dotnet pack -c Release --no-build -v minimal -o ${{ env.NuGetDirectory }} -p:PackageVersion=$NUGET_VERSION
- name: Publish NuGet package
if: success() && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
run: dotnet nuget push "${{ env.NuGetDirectory }}/*.nupkg" --api-key "${{ secrets.NUGET_PUSH }}" --source https://api.nuget.org/v3/index.json --skip-duplicate
- name: Upload files to a GitHub release
if: success() && github.ref_type == 'tag' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository)
uses: xresloader/[email protected]
with:
file: ${{ env.NuGetDirectory }}/*.nupkg
tags: true
overwrite: true
tag_name: ${{ github.ref_name }}
37 changes: 25 additions & 12 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"version": "2.0.0",
"command": "dotnet",
"isShellCommand": true,
"args": [],
"tasks": [
{
"taskName": "build",
"args": [ "progaudi.tarantool.sln"],
"isBuildCommand": true,
"showOutput": "silent",
"problemMatcher": "$msCompile"
"label": "build",
"type": "shell",
"command": "dotnet",
"args": [
"build",
"progaudi.tarantool.sln"
],
"problemMatcher": "$msCompile",
"group": {
"_id": "build",
"isDefault": false
}
},
{
"taskName": "test",
"args": [ "tests/progaudi.tarantool.tests/progaudi.tarantool.tests.csproj"],
"isTestCommand": true,
"showOutput": "silent",
"problemMatcher": "$msCompile"
"label": "test",
"type": "shell",
"command": "dotnet",
"args": [
"test",
"tests/progaudi.tarantool.tests/progaudi.tarantool.tests.csproj"
],
"problemMatcher": "$msCompile",
"group": {
"_id": "test",
"isDefault": false
}
}
]
}
8 changes: 8 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>
<PropertyGroup>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<MSBuildTreatWarningsAsErrors>true</MSBuildTreatWarningsAsErrors>
<IsPublishable>false</IsPublishable>
<NoWarn>NETSDK1138</NoWarn>
</PropertyGroup>
</Project>
21 changes: 21 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="MsgPack.Light" Version="2.0.1" />
<PackageVersion Include="System.Net.NameResolution" Version="4.3.0" />
<PackageVersion Include="System.Threading.Thread" Version="4.3.0" />

<!-- benchmark -->
<PackageVersion Include="BenchmarkDotNet" Version="0.10.12" />
<PackageVersion Include="StackExchange.Redis" Version="1.2.6" />

<!-- tests -->
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageVersion Include="xunit" Version="2.4.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageVersion Include="JetBrains.Annotations" Version="2018.2.1" />
<PackageVersion Include="Shouldly" Version="3.0.1" />
</ItemGroup>
</Project>
12 changes: 6 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ version: '3.2'

services:
tarantool_1_7:
image: progaudi/tarantool:1.7.5-184-g5be3a82be # same version as tarantool in homebrew on mac os
build:
context: tarantool
dockerfile: docker/Dockerfile.1.7
command: tarantool /usr/local/share/tarantool/tarantool.docker.lua
volumes:
- $PWD/tarantool:/usr/local/share/tarantool
ports:
- "3301:3301"
environment:
Expand All @@ -14,10 +14,10 @@ services:
TARANTOOL_SLAB_ALLOC_ARENA: 0.1

tarantool_1_8:
image: progaudi/tarantool:1.8.2-288-g99128d7d3
build:
context: tarantool
dockerfile: docker/Dockerfile.1.8
command: tarantool /usr/local/share/tarantool/tarantool.docker.lua
volumes:
- $PWD/tarantool:/usr/local/share/tarantool
ports:
- "3302:3301"
environment:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<WarningsAsErrors>true</WarningsAsErrors>

<AssemblyName>progaudi.tarantool.benchmark</AssemblyName>
Expand All @@ -12,8 +12,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.10.12" />
<PackageReference Include="StackExchange.Redis" Version="1.2.6" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="StackExchange.Redis" />
</ItemGroup>

<ItemGroup>
Expand Down
21 changes: 14 additions & 7 deletions src/progaudi.tarantool/progaudi.tarantool.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
<TargetFrameworks>net46;netstandard1.4;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0;net60</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT' ">
<TargetFrameworks>netstandard1.4;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0;net60</TargetFrameworks>
</PropertyGroup>
<PropertyGroup>
<PatchLevelVersion Condition=" '$(BuildNumber)' == '' ">0</PatchLevelVersion>
Expand All @@ -16,21 +16,23 @@
<AssemblyName>progaudi.tarantool</AssemblyName>
<RootNamespace>ProGaudi.Tarantool.Client</RootNamespace>
<Product>progaudi.tarantool</Product>
<Copyright>Copyright © 2016-2018</Copyright>
<Copyright>Copyright © 2016-2023</Copyright>

<PackageTags>tarantool;csharp</PackageTags>
<PackageProjectUrl>https://github.com/progaudi/progaudi.tarantool</PackageProjectUrl>
<PackageLicenseUrl>https://raw.githubusercontent.com/progaudi/progaudi.tarantool/master/LICENSE</PackageLicenseUrl>

<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseFile>LICENSE</PackageLicenseFile>

<GenerateAssemblyTitleAttribute>true</GenerateAssemblyTitleAttribute>
<GenerateAssemblyProductAttribute>true</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>true</GenerateAssemblyCopyrightAttribute>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MsgPack.Light" Version="1.6.2" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Threading.Thread" Version="4.3.0" />
<PackageReference Include="MsgPack.Light" />
<PackageReference Include="System.Net.NameResolution" />
<PackageReference Include="System.Threading.Thread" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -83,4 +85,9 @@
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard1.4' ">
<DefineConstants>$(DefineConstants);PROGAUDI_NETCORE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Include="..\..\LICENSE" Pack="true" PackagePath="\"/>
<None Include="..\..\README.md" Pack="true" PackagePath="\"/>
</ItemGroup>
</Project>
6 changes: 6 additions & 0 deletions tarantool/docker/Dockerfile.1.7
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM progaudi/tarantool:1.7.5-184-g5be3a82be

RUN set -x \
&& mkdir -p /usr/local/share/tarantool

COPY --chown=tarantool:tarantool *.lua /usr/local/share/tarantool/
6 changes: 6 additions & 0 deletions tarantool/docker/Dockerfile.1.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM progaudi/tarantool:1.8.2-288-g99128d7d3

RUN set -x \
&& mkdir -p /usr/local/share/tarantool

COPY --chown=tarantool:tarantool *.lua /usr/local/share/tarantool/
16 changes: 8 additions & 8 deletions tests/progaudi.tarantool.tests/progaudi.tarantool.tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
<PropertyGroup>
<Description>progaudi.tarantool Class Library tests</Description>
<OutputType>Exe</OutputType>
<TargetFrameworks>netcoreapp1.0;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
<TargetFrameworks>netcoreapp3.1;net6.0</TargetFrameworks>
<WarningsAsErrors>true</WarningsAsErrors>

<AssemblyName>progaudi.tarantool.tests</AssemblyName>
<RootNamespace>ProGaudi.Tarantool.Client.Tests</RootNamespace>
<Product>progaudi.tarantool</Product>
<Copyright>Copyright © 2016-2017</Copyright>
<Copyright>Copyright © 2016-2023</Copyright>

<PackageTags>tarantool;csharp;tests</PackageTags>
<PackageProjectUrl>https://github.com/progaudi/progaudi.tarantool</PackageProjectUrl>
Expand All @@ -22,12 +22,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.8.0" />
<PackageReference Include="StackExchange.Redis" Version="1.2.6" />
<PackageReference Include="xunit" Version="2.4.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.0" />
<PackageReference Include="JetBrains.Annotations" Version="2018.2.1" />
<PackageReference Include="Shouldly" Version="3.0.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="StackExchange.Redis" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="JetBrains.Annotations" />
<PackageReference Include="Shouldly" />
<ProjectReference Include="..\..\src\progaudi.tarantool\progaudi.tarantool.csproj" />
</ItemGroup>

Expand Down