Fix unit tests #676
Workflow file for this run
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 | |
# Controls when the action will run. Triggers the workflow on push or pull request | |
on: | |
push: | |
branches: | |
- dev | |
- future | |
tags: | |
- v[0-9]+.[0-9]+.[0-9]+ # Matches all semantic versioning tags with major, minor, patch | |
pull_request: | |
branches: | |
- dev | |
- future | |
env: | |
MORYX_OPTIMIZE_CODE: "false" | |
MORYX_BUILD_CONFIG: "Release" | |
MORYX_BUILDNUMBER: ${{github.run_number}} | |
dotnet_sdk_version: '5.0.403' | |
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true | |
jobs: | |
Build: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.dotnet_sdk_version }} | |
- name: Build | |
shell: pwsh | |
run: ./Build.ps1 -Build -Pack | |
- name: Upload package artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: packages | |
path: artifacts/Packages/ | |
retention-days: 1 | |
UnitTests: | |
needs: [Build] | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.dotnet_sdk_version }} | |
- name: Execute Unit Tests | |
shell: pwsh | |
run: ./Build.ps1 -UnitTests | |
- name: Upload test results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-results | |
path: artifacts/Tests/ | |
retention-days: 1 | |
IntegrationTests: | |
needs: [Build] | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.dotnet_sdk_version }} | |
- name: Execute Integration Tests | |
shell: pwsh | |
run: ./Build.ps1 -IntegrationTests | |
- name: Upload test results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: test-results | |
path: artifacts/Tests/ | |
retention-days: 1 | |
Codecov: | |
needs: [UnitTests, IntegrationTests] | |
runs-on: windows-2019 | |
steps: | |
- name: Download test results | |
uses: actions/download-artifact@v2 | |
with: | |
name: test-results | |
path: artifacts/Tests/ | |
- name: Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
files: '*.OpenCover.xml' | |
Documentation: | |
needs: [Build] | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Generate docFx | |
shell: pwsh | |
run: ./Build.ps1 -GenerateDocs | |
- name: Upload documentation results | |
uses: actions/upload-artifact@v2 | |
with: | |
name: documentation | |
path: artifacts/Documentation/ | |
retention-days: 1 | |
Publish: | |
needs: [Build, UnitTests, IntegrationTests] | |
if: ${{ github.event_name == 'push' }} | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Setup .NET SDK | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: ${{ env.dotnet_sdk_version }} | |
- name: Download package artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
name: packages | |
path: artifacts/Packages/ | |
- name: Publish on MyGet-CI | |
if: ${{ github.ref == 'refs/heads/dev' }} # dev branche is published to myget moryx | |
shell: pwsh | |
env: | |
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}} | |
MORYX_PACKAGE_TARGET: "https://www.myget.org/F/moryx/api/v2/package" | |
MORYX_PACKAGE_TARGET_V3: "https://www.myget.org/F/moryx/api/v3/index.json" | |
run: ./Build.ps1 -Publish | |
- name: Publish on MyGet-Future | |
if: ${{ github.ref == 'refs/heads/future' }} # Future branch is published to myget moryx-future | |
shell: pwsh | |
env: | |
MORYX_NUGET_APIKEY: ${{secrets.MYGET_TOKEN}} | |
MORYX_PACKAGE_TARGET: "https://www.myget.org/F/moryx-future/api/v2/package" | |
MORYX_PACKAGE_TARGET_V3: "https://www.myget.org/F/moryx-future/api/v3/index.json" | |
run: ./Build.ps1 -Publish | |
- name: Publish on NuGet | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} # Version Tags are published to nuget | |
shell: pwsh | |
env: | |
MORYX_NUGET_APIKEY: ${{secrets.NUGET_TOKEN}} | |
MORYX_PACKAGE_TARGET: "https://api.nuget.org/v3/index.json" | |
MORYX_PACKAGE_TARGET_V3: "https://api.nuget.org/v3/index.json" | |
run: ./Build.ps1 -Publish |