V1 implementation #267
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: .NET | |
on: | |
pull_request: | |
branches: | |
- 'main' | |
- 'release/**' | |
concurrency: ${{ github.ref }} | |
jobs: | |
version: | |
name: Version with GitVersion ${{ vars.GIT_VERSION }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Install GitVersion ${{ vars.GIT_VERSION }} | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
versionSpec: ${{ vars.GIT_VERSION }} | |
preferLatestVersion: true | |
- name: Update Version with GitVersion ${{ vars.GIT_VERSION }} | |
uses: gittools/actions/gitversion/[email protected] | |
with: | |
useConfigFile: true | |
configFilePath: ./.gitversion/version.yml | |
updateAssemblyInfo: true | |
- run: 'echo FullSemVer: ${{ env.fullSemVer }}' | |
build: | |
name: Build with .NET ${{ vars.DOTNET_VERSION }} | |
needs: [version] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET ${{ vars.DOTNET_VERSION }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ vars.DOTNET_VERSION }} | |
- name: Build with .NET ${{ vars.DOTNET_VERSION }} | |
run: dotnet build ./src/**/*.csproj --configuration ${{ vars.BUILD_CONFIGURATION }} /p:Platform=${{ vars.BUILD_PLATFORM }} | |
- name: Upload Build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build | |
path: | | |
**/bin/* | |
**/obj/* | |
test: | |
name: Test with .NET ${{ vars.DOTNET_VERSION }} | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup .NET ${{ vars.DOTNET_VERSION }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ vars.DOTNET_VERSION }} | |
- name: Test with .NET ${{ vars.DOTNET_VERSION }} | |
run: dotnet test ./tests/**/*Tests.csproj --configuration ${{ vars.BUILD_CONFIGURATION }} /p:Platform=${{ vars.BUILD_PLATFORM }} --verbosity normal --settings unit-test.runsettings --logger trx --collect:"Code Coverage" --results-directory test-results | |
- name: Upload Test Results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: test-results | |
path: | | |
**/test-results/* | |
pack: | |
name: Pack with .NET ${{ vars.DOTNET_VERSION }} | |
needs: [test] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install .NET ${{ vars.DOTNET_VERSION }} | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: ${{ vars.DOTNET_VERSION }} | |
- name: Download Build | |
uses: actions/download-artifact@v4 | |
with: | |
name: build | |
- name: Pack with .NET ${{ vars.DOTNET_VERSION }} | |
run: dotnet pack ./src/**/*.csproj --no-build --no-restore --configuration ${{ vars.BUILD_CONFIGURATION }} /p:Platform=${{ vars.BUILD_PLATFORM }} | |
- name: Upload Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: package | |
path: | | |
**/*.nupkg |