Merge pull request #318 from justeat/incident-api-sideloading #90
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
name: ci | |
on: | |
push: | |
branches: [ master ] | |
tags: [ v* ] | |
pull_request: | |
branches: [ master, develop ] | |
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 | |
- 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: Package | |
shell: pwsh | |
run: ./build.ps1 --target=Package | |
- name: Publish NuGet package to Github actions cache | |
uses: actions/upload-artifact@v3 | |
with: | |
name: packages-windows | |
path: ./artifacts | |
if-no-files-found: error | |
run-integration-tests: | |
runs-on: windows-latest | |
if: | | |
github.event.repository.fork == false && | |
github.event.pull_request.head.ref == 'develop' | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v3 | |
- 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 }} | |
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 | |
- 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 |