Skip to content

Commit d504da6

Browse files
authored
Add workflows to the project. (#59)
* Add workflows to the project. * Remove empty line. * Use .NET Core 3.1 for running tests. * Remove appVeyor.
1 parent 935d8b8 commit d504da6

File tree

5 files changed

+67
-29
lines changed

5 files changed

+67
-29
lines changed

.github/workflows/buildAndTest.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Build And Test
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Setup .NET Core
17+
uses: actions/setup-dotnet@v1
18+
with:
19+
dotnet-version: 3.1.101
20+
- name: Install dependencies
21+
run: dotnet restore
22+
- name: Build
23+
run: dotnet build --configuration Release --no-restore
24+
- name: Test
25+
run: dotnet test --no-restore --verbosity normal --collect:"XPlat Code Coverage" --results-directory:testResults
26+
- uses: codecov/codecov-action@v1
27+
with:
28+
file: testResults/**/coverage.cobertura.xml
29+
fail_ci_if_error: true
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: Publish package
4+
5+
# Controls when the action will run. Triggers the workflow on push or pull request
6+
# events but only for the master branch
7+
on:
8+
release:
9+
types: [published]
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Setup .NET Core
16+
uses: actions/setup-dotnet@v1
17+
with:
18+
dotnet-version: 3.1.101
19+
- name: Install dependencies
20+
run: dotnet restore
21+
- name: Build
22+
run: dotnet build --configuration Release --no-restore
23+
- name: Test
24+
run: dotnet test --no-restore --verbosity normal
25+
- name: Create package
26+
run: dotnet pack --output Package
27+
- name: Publish package
28+
run: dotnet nuget push Package\**\*.nupkg -s https://api.nuget.org/v3/index.json --no-symbols true --skip-duplicate -k ${{secrets.NUGET_AUTH_TOKEN}}

analyzer/CommandLine.Analyzer.Test/CommandLine.Analyzer.Test.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@
22

33
<PropertyGroup>
44
<DebugType>full</DebugType>
5-
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>
99
<PackageReference Include="CommandLine.Net" Version="1.5.0" />
10+
<PackageReference Include="coverlet.collector" Version="1.2.1">
11+
<PrivateAssets>all</PrivateAssets>
12+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
13+
</PackageReference>
1014
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="2.8.2">
1115
<PrivateAssets>all</PrivateAssets>
1216
</PackageReference>

appveyor.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

test/CommandLine.Tests.csproj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@
22

33
<PropertyGroup>
44
<DebugType>full</DebugType>
5-
<TargetFrameworks>netcoreapp2.0</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1</TargetFrameworks>
66
</PropertyGroup>
77

88
<ItemGroup>
9+
<PackageReference Include="coverlet.collector" Version="1.2.1">
10+
<PrivateAssets>all</PrivateAssets>
11+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
12+
</PackageReference>
913
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.7.2" />
1014
<PackageReference Include="xunit" Version="2.3.1" />
1115
<PackageReference Include="xunit.analyzers" Version="0.9.0" />

0 commit comments

Comments
 (0)