-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #287 from Ud0o/enable-github-actions
CCAS-1418 add github actions ci workflow
- Loading branch information
Showing
2 changed files
with
94 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
tags: [ v* ] | ||
pull_request: | ||
branches: [ master, dotnet-vnext ] | ||
workflow_dispatch: | ||
|
||
env: | ||
DOTNET_CLI_TELEMETRY_OPTOUT: true | ||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | ||
DOTNET_SYSTEM_CONSOLE_ALLOW_ANSI_COLOR_REDIRECTION: 1 | ||
NUGET_XMLDOC_MODE: skip | ||
TERM: xterm | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
name: windows-latest | ||
runs-on: windows-latest | ||
|
||
steps: | ||
|
||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Setup NuGet cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.nuget/packages | ||
key: windows-latest-nuget-${{ hashFiles('**/*.csproj', '**/*.props') }} | ||
restore-keys: windows-latest-nuget- | ||
|
||
- name: Build & Unit tests | ||
shell: pwsh | ||
run: ./build.ps1 --target=Run-Unit-Tests | ||
|
||
# - name: Run Integration tests | ||
# shell: pwsh | ||
# run: ./build.ps1 --target=Run-Integration-Tests --zendeskUrl=${{ secrets.ZENDESK_URL }} --zendeskUsername=${{ secrets.ZENDESK_USERNAME }} --zendeskToken=${{ secrets.ZENDESK_TOKEN }} | ||
|
||
- name: Package | ||
shell: pwsh | ||
run: ./build.ps1 --target=Package | ||
|
||
- name: Publish NuGet package to Github actions cache | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: packages-${{ matrix.os_name }} | ||
path: ./artifacts | ||
if-no-files-found: error | ||
|
||
publish-nuget: | ||
needs: build | ||
runs-on: windows-latest | ||
if: | | ||
github.event.repository.fork == false && | ||
startsWith(github.ref, 'refs/tags/v') | ||
steps: | ||
|
||
- name: Download packages | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: packages-windows | ||
|
||
- name: Setup .NET SDK | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '3.1.x' | ||
|
||
- name: Push NuGet packages to NuGet.org | ||
run: dotnet nuget push "*.nupkg" --api-key ${{ secrets.NUGET_TOKEN }} --skip-duplicate --source https://api.nuget.org/v3/index.json |
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