Introduce githuh action (#364)

* gh build and test

* fix dotnet env

* fix DisposeWatch test fickle

* mini 0??

* nuget push from gh
This commit is contained in:
Boshi Lian
2020-03-10 15:19:57 -07:00
committed by GitHub
parent 7749ae07c8
commit c8de0ca263
3 changed files with 50 additions and 20 deletions

29
.github/workflows/dotnet.yaml vendored Normal file
View File

@@ -0,0 +1,29 @@
name: .NET Core
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
name: Dotnet build
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108
- run: dotnet build --configuration Release
- name: test with dotnet
run: dotnet test /p:CollectCoverage=true /p:Exclude="[KubernetesClient]k8s.Models.*" /p:Exclude="[KubernetesClient]k8s.Internal.*" /p:CollectCoverage=true /p:CoverletOutputFormat="cobertura"
- uses: 5monkeys/cobertura-action@master
with:
path: tests/KubernetesClient.Tests/coverage.netcoreapp2.1.cobertura.xml
repo_token: ${{ secrets.GITHUB_TOKEN }}
minimum_coverage: 0
on:
pull_request:
types: [assigned, opened, synchronize, reopened]

21
.github/workflows/nuget.yaml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Nuget
on:
push:
branches: [ master ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v1
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 2.2.108
- name: pack
run: dotnet pack --configuration Release src/KubernetesClient -o pkg
- name: push
run: dotnet nuget push pkg\*.nupkg -s https://www.nuget.org/ -k ${{ secrets.nuget_api_key }}

View File

@@ -1,20 +0,0 @@
jobs:
build:
runs-on: ubuntu-18.04
strategy:
matrix:
dotnet: [ '2.2.103', '3.0.100' ]
name: Dotnet ${{ matrix.dotnet }} sample
steps:
- uses: actions/checkout@master
with:
fetch-depth: 0
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet }}
- run: dotnet build
on:
pull_request:
types: [assigned, opened, synchronize, reopened]