Skip to content

fixed pipeline and imroved wiki #79

fixed pipeline and imroved wiki

fixed pipeline and imroved wiki #79

Workflow file for this run

name: CI-CD
on:
push:
tags:
- "*v*"
jobs:
build:
name: Build
env:
BUILD_CONFIG: 'Debug'
SOLUTION: 'Modules.sln'
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
submodules: recursive
- name: 'Get Version'
id: get_version
uses: battila7/get-version-action@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 1.11
- name: Cache SonarQube packages
uses: actions/cache@v1
with:
path: ~\sonar\cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache SonarQube scanner
id: cache-sonar-scanner
uses: actions/cache@v1
with:
path: .\.sonar\scanner
key: ${{ runner.os }}-sonar-scanner
restore-keys: ${{ runner.os }}-sonar-scanner
- name: Install SonarQube scanner
if: steps.cache-sonar-scanner.outputs.cache-hit != 'true'
shell: powershell
run: |
New-Item -Path .\.sonar\scanner -ItemType Directory
dotnet tool update dotnet-sonarscanner --tool-path .\.sonar\scanner
- name: Install dotCover Global
shell: powershell
run: |
dotnet tool install --global JetBrains.dotCover.GlobalTool
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: powershell
run: |
Write-Output ${{ steps.get_version.outputs.version-without-v }}
.\.sonar\scanner\dotnet-sonarscanner begin /k:"${{ secrets.SONAR_PROJECT }}" /d:sonar.login="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="${{ secrets.SONAR_HOST_URL }}" /v:"${{ steps.get_version.outputs.version-without-v }}"
dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG
dotnet dotcover test $env:SOLUTION --dcReportType=HTML --dotCoverFilters="-:*Tests;-:testhost"
.\.sonar\scanner\dotnet-sonarscanner end /d:sonar.login="${{ secrets.SONAR_TOKEN }}"
deploy:
name: 'Build, Test & Deploy'
env:
BUILD_CONFIG: 'Release'
SOLUTION: './Modules.sln'
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: recursive
- name: 'Get Version'
id: get_version
uses: battila7/get-version-action@v2
- name: Install .NET Core
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v1.0.2
- name: Restore dependencies
run: nuget restore $env:SOLUTION
- name: Build
run: dotnet build $env:SOLUTION --configuration $env:BUILD_CONFIG --no-restore
- name: Run tests
run: dotnet test $env:SOLUTION /p:Configuration=$env:BUILD_CONFIG --no-restore --no-build --verbosity normal
- name: Pack Modules
shell: pwsh
run: '& .\dotnet-tools\PackPackages.ps1 -CustomProjectsFile .projects.conf'
- name: Push to NuGet Modules
shell: pwsh
run: '& .\dotnet-tools\PushPackages.ps1 -CustomProjectsFile .projects.conf -Source https://api.nuget.org/v3/index.json -ApiKey ${{secrets.NUGET_API_KEY}}'
- name: Push to GitHub Modules
shell: pwsh
run: '& .\dotnet-tools\PushPackages.ps1 -CustomProjectsFile .projects.conf -Source https://nuget.pkg.github.com/joshika39/index.json -ApiKey ${{secrets.GIT_API_KEY}}'