From c8de0ca263a2960add4c9a90831c8902fc3a4af7 Mon Sep 17 00:00:00 2001 From: Boshi Lian Date: Tue, 10 Mar 2020 15:19:57 -0700 Subject: [PATCH] Introduce githuh action (#364) * gh build and test * fix dotnet env * fix DisposeWatch test fickle * mini 0?? * nuget push from gh --- .github/workflows/dotnet.yaml | 29 +++++++++++++++++++++++++++++ .github/workflows/nuget.yaml | 21 +++++++++++++++++++++ .github/workflows/test.yaml | 20 -------------------- 3 files changed, 50 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/dotnet.yaml create mode 100644 .github/workflows/nuget.yaml delete mode 100644 .github/workflows/test.yaml diff --git a/.github/workflows/dotnet.yaml b/.github/workflows/dotnet.yaml new file mode 100644 index 0000000..7ee3fcd --- /dev/null +++ b/.github/workflows/dotnet.yaml @@ -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] diff --git a/.github/workflows/nuget.yaml b/.github/workflows/nuget.yaml new file mode 100644 index 0000000..cbff77f --- /dev/null +++ b/.github/workflows/nuget.yaml @@ -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 }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml deleted file mode 100644 index 4b2e581..0000000 --- a/.github/workflows/test.yaml +++ /dev/null @@ -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]