Skip to content

Commit 63e7e70

Browse files
authored
Use github workflows for CI (icsharpcode#419)
* Add Github Actions workflows * Use VS 2019 in AppVeyor CI
1 parent 96b4d86 commit 63e7e70

File tree

6 files changed

+340
-82
lines changed

6 files changed

+340
-82
lines changed

Diff for: .editorconfig

+4
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,7 @@ indent_size = 2
3333
end_of_line = lf
3434
[*.{cmd, bat}]
3535
end_of_line = crlf
36+
37+
[*.yml]
38+
indent_style = space
39+
indent_size = 2

Diff for: .github/workflows/on-push.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Build master on push
2+
3+
env:
4+
PUBLISH_DEV_PACKS: disabled
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
10+
jobs:
11+
BuildAndTest:
12+
runs-on: ${{ matrix.os }}-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
configuration: [debug, release]
17+
os: [ubuntu, windows, macos]
18+
libtarget: [netstandard2]
19+
testtarget: [netcoreapp3.1]
20+
include:
21+
- configuration: debug
22+
os: windows
23+
libtarget: net45
24+
testtarget: net45
25+
- configuration: release
26+
os: windows
27+
libtarget: net45
28+
testtarget: net45
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Setup .NET Core
33+
if: matrix.libtarget == 'netstandard2'
34+
uses: actions/setup-dotnet@v1
35+
with:
36+
dotnet-version: '3.1.x'
37+
38+
- name: Build library
39+
run: dotnet build -c ${{ matrix.configuration }} -f ${{ matrix.libtarget }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
40+
41+
- name: Restore test dependencies
42+
run: dotnet restore
43+
44+
- name: Run tests
45+
run: dotnet test -c ${{ matrix.configuration }} -f ${{ matrix.testtarget }} --no-restore
46+
47+
48+
Package:
49+
if: env.PUBLISH_DEV_PACKS != 'disabled'
50+
needs: [BuildAndTest]
51+
runs-on: windows-latest
52+
env:
53+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
54+
55+
steps:
56+
- uses: actions/checkout@v2
57+
with:
58+
fetch-depth: 0
59+
60+
- name: Setup .NET Core
61+
uses: actions/setup-dotnet@v1
62+
with:
63+
dotnet-version: '3.1.x'
64+
source-url: https://nuget.pkg.github.com/icsharpcode/index.json
65+
66+
- name: Build library for .NET Standard 2
67+
run: dotnet build -c Release -f netstandard2 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
68+
- name: Build library for .NET Framework 4.5
69+
run: dotnet build -c Release -f net45 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
70+
71+
- name: Create nuget package
72+
run: dotnet pack src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:Version=$(git describe --abbrev | % { $_.substring(1) })
73+
74+
- name: Show package name
75+
run: ls dist\*.nupkg
76+
77+
- name: Publish the package to GPR
78+
if: env.PUBLISH_DEV_PACKS == 'enabled'
79+
run: dotnet nuget push dist\*.nupkg

Diff for: .github/workflows/pull-request.yml

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Build and Test PR
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
Build:
9+
runs-on: ${{ matrix.os }}-latest
10+
strategy:
11+
fail-fast: false
12+
matrix:
13+
configuration: [debug, release]
14+
os: [ubuntu, windows, macos]
15+
target: [netstandard2]
16+
include:
17+
- configuration: Debug
18+
os: windows
19+
target: net45
20+
- configuration: Release
21+
os: windows
22+
target: net45
23+
steps:
24+
- uses: actions/checkout@v2
25+
26+
- name: Setup .NET Core
27+
if: matrix.target == 'netstandard2'
28+
uses: actions/setup-dotnet@v1
29+
with:
30+
dotnet-version: '3.1.x'
31+
32+
- name: Build library
33+
run: dotnet build -c ${{ matrix.configuration }} -f ${{ matrix.target }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
34+
35+
Test:
36+
runs-on: ${{ matrix.os }}-latest
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
configuration: [debug, release]
41+
os: [ubuntu, windows, macos]
42+
target: [netcoreapp3.1]
43+
include:
44+
- configuration: debug
45+
os: windows
46+
target: net45
47+
- configuration: release
48+
os: windows
49+
target: net45
50+
steps:
51+
- uses: actions/checkout@v2
52+
53+
- name: Setup .NET Core
54+
if: matrix.target == 'netcoreapp3.1'
55+
uses: actions/setup-dotnet@v1
56+
with:
57+
dotnet-version: '3.1.x'
58+
59+
- name: Restore test dependencies
60+
run: dotnet restore
61+
62+
- name: Run tests
63+
run: dotnet test -c ${{ matrix.configuration }} -f ${{ matrix.target }} --no-restore
64+
65+
Pack:
66+
needs: [Build, Test]
67+
runs-on: windows-latest
68+
env:
69+
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
70+
71+
steps:
72+
- uses: actions/checkout@v2
73+
with:
74+
fetch-depth: 0
75+
76+
- name: Setup .NET Core
77+
uses: actions/setup-dotnet@v1
78+
with:
79+
dotnet-version: '3.1.x'
80+
81+
- name: Build library for .NET Standard 2
82+
run: dotnet build -c Release -f netstandard2 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
83+
- name: Build library for .NET Framework 4.5
84+
run: dotnet build -c Release -f net45 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj
85+
86+
- name: Create nuget package
87+
run: dotnet pack src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:Version=$(git describe --abbrev | % { $_.substring(1) })-PR
88+
89+
- name: Upload nuget package artifact
90+
uses: actions/upload-artifact@v2
91+
with:
92+
name: Nuget package
93+
path: dist/*.nupkg

Diff for: appveyor.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
version: '{build}'
2-
image: Visual Studio 2017
2+
image: Visual Studio 2019
33
configuration:
44
- Debug
55
- Release
@@ -31,4 +31,4 @@ test_script:
3131
artifacts:
3232
- path: docs\help\_site
3333
type: zip
34-
name: Documentation
34+
name: Documentation

Diff for: test/ICSharpCode.SharpZipLib.Tests/ICSharpCode.SharpZipLib.Tests.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Library</OutputType>
5-
<TargetFrameworks>netcoreapp2.0;net46</TargetFrameworks>
5+
<TargetFrameworks>netcoreapp3.1;net46</TargetFrameworks>
66
<ApplicationIcon />
77
<StartupObject />
88
</PropertyGroup>

0 commit comments

Comments
 (0)