You are on page 1of 2

actions.

yml file for C# applications

==============================

name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

# A workflow run is made up of one or more jobs that can run sequentially or in
parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: windows-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: download build tools


run: Invoke-webrequest -uri https://aka.ms/vs/16/release/vs_buildtools.exe -
OutFile vs_buildtools.exe
shell: powershell

- name: install build tools with required packages


run: .\vs_buildtools.exe --wait --norestart --passive --installPath "C:\
Program Files (x86)\Microsoft Visual Studio\2019\BuildTools" --includeOptional --
includeRecommended --add Microsoft.VisualStudio.Workload.ManagedDesktopBuildTools
--add Microsoft.VisualStudio.Workload.MSBuildTools --add
Microsoft.VisualStudio.Workload.NativeDesktop --add
Microsoft.VisualStudio.Workload.NetCoreTools
shell: cmd

- name: set MSBuildSDKsPath env variable


run: echo ::set-env name=MSBuildSDKsPath::"C:\Program Files (x86)\Microsoft
Visual Studio\2019\Enterprise\MSBuild\Sdks"

- name: download DesigniteConsole.exe and unpack


run: |
curl.exe -o DesigniteConsole.zip
"http://www.designite-tools.com/download/DesigniteConsole.zip"
powershell.exe -nologo -noprofile -command "& { Add-Type -A
'System.IO.Compression.FileSystem';
[IO.Compression.ZipFile]::ExtractToDirectory('DesigniteConsole.zip','.');}"

- name: Run Designite and send the analysis report to QScored


run: |
.\DesigniteConsole\DesigniteConsole.exe -ci -repo ${{github.repository}} -
pat ${{ secrets.PAT }} -k ${{ secrets.D_KEY }}
# cat Designite_output/DesigniteAnalysis.xml
curl -X PUT -H "Authorization: Token ${{ secrets.QSCORED_API_KEY }}" -H
"repository-link:https://github.com/" + ${{github.repository}} -H "username: <Your
email>" -H "Content-Type: mulitpart/form-data" --url
"https://qscored.com/api/upload/file.xml?is_open_access=off&version=$
{{github.run_number}}&project_name=<Project name>" -F
"file=@Designite_output/DesigniteAnalysis.xml"

You might also like