forked from icsharpcode/SharpZipLib
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use github workflows for CI (icsharpcode#419)
* Add Github Actions workflows * Use VS 2019 in AppVeyor CI
- Loading branch information
Showing
6 changed files
with
340 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,3 +33,7 @@ indent_size = 2 | |
end_of_line = lf | ||
[*.{cmd, bat}] | ||
end_of_line = crlf | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
name: Build master on push | ||
|
||
env: | ||
PUBLISH_DEV_PACKS: disabled | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
|
||
jobs: | ||
BuildAndTest: | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [debug, release] | ||
os: [ubuntu, windows, macos] | ||
libtarget: [netstandard2] | ||
testtarget: [netcoreapp3.1] | ||
include: | ||
- configuration: debug | ||
os: windows | ||
libtarget: net45 | ||
testtarget: net45 | ||
- configuration: release | ||
os: windows | ||
libtarget: net45 | ||
testtarget: net45 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET Core | ||
if: matrix.libtarget == 'netstandard2' | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Build library | ||
run: dotnet build -c ${{ matrix.configuration }} -f ${{ matrix.libtarget }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
|
||
- name: Restore test dependencies | ||
run: dotnet restore | ||
|
||
- name: Run tests | ||
run: dotnet test -c ${{ matrix.configuration }} -f ${{ matrix.testtarget }} --no-restore | ||
|
||
|
||
Package: | ||
if: env.PUBLISH_DEV_PACKS != 'disabled' | ||
needs: [BuildAndTest] | ||
runs-on: windows-latest | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
source-url: https://nuget.pkg.github.com/icsharpcode/index.json | ||
|
||
- name: Build library for .NET Standard 2 | ||
run: dotnet build -c Release -f netstandard2 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
- name: Build library for .NET Framework 4.5 | ||
run: dotnet build -c Release -f net45 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
|
||
- name: Create nuget package | ||
run: dotnet pack src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:Version=$(git describe --abbrev | % { $_.substring(1) }) | ||
|
||
- name: Show package name | ||
run: ls dist\*.nupkg | ||
|
||
- name: Publish the package to GPR | ||
if: env.PUBLISH_DEV_PACKS == 'enabled' | ||
run: dotnet nuget push dist\*.nupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
name: Build and Test PR | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
Build: | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [debug, release] | ||
os: [ubuntu, windows, macos] | ||
target: [netstandard2] | ||
include: | ||
- configuration: Debug | ||
os: windows | ||
target: net45 | ||
- configuration: Release | ||
os: windows | ||
target: net45 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET Core | ||
if: matrix.target == 'netstandard2' | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Build library | ||
run: dotnet build -c ${{ matrix.configuration }} -f ${{ matrix.target }} src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
|
||
Test: | ||
runs-on: ${{ matrix.os }}-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [debug, release] | ||
os: [ubuntu, windows, macos] | ||
target: [netcoreapp3.1] | ||
include: | ||
- configuration: debug | ||
os: windows | ||
target: net45 | ||
- configuration: release | ||
os: windows | ||
target: net45 | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Setup .NET Core | ||
if: matrix.target == 'netcoreapp3.1' | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Restore test dependencies | ||
run: dotnet restore | ||
|
||
- name: Run tests | ||
run: dotnet test -c ${{ matrix.configuration }} -f ${{ matrix.target }} --no-restore | ||
|
||
Pack: | ||
needs: [Build, Test] | ||
runs-on: windows-latest | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v1 | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Build library for .NET Standard 2 | ||
run: dotnet build -c Release -f netstandard2 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
- name: Build library for .NET Framework 4.5 | ||
run: dotnet build -c Release -f net45 src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj | ||
|
||
- name: Create nuget package | ||
run: dotnet pack src/ICSharpCode.SharpZipLib/ICSharpCode.SharpZipLib.csproj --configuration Release --output dist /p:Version=$(git describe --abbrev | % { $_.substring(1) })-PR | ||
|
||
- name: Upload nuget package artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: Nuget package | ||
path: dist/*.nupkg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.