Skip to content

Merge pull request #28 from IowaComputerGurus/dependabot/github_actio… #36

Merge pull request #28 from IowaComputerGurus/dependabot/github_actio…

Merge pull request #28 from IowaComputerGurus/dependabot/github_actio… #36

Workflow file for this run

name: CI Build
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
code-quality:
if: github.actor != 'dependabot[bot]'
runs-on: windows-latest
name: Build and Analyze
env:
solution-path: './src/AspNetCore Bootstrap 5 Tag Helpers.sln'
steps:
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: zulu
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Install GitVersion
run: dotnet tool install --global GitVersion.Tool
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/[email protected]
with:
useConfigFile: true
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
shell: powershell
run: |
dotnet restore "${{ env.solution-path }}"
dotnet build "${{ env.solution-path }}" --no-restore --configuration Release -p:version=${{ steps.gitversion.outputs.majorMinorPatch }}
dotnet test "${{ env.solution-path }}" --no-build --configuration Release --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover --logger "trx;LogFileName=unittests.trx"
- name: Push Coverage to Codacy
shell: bash
env:
CODACY_ORGANIZATION_PROVIDER: ${{ secrets.CODACY_ORGANIZATION_PROVIDER }}
CODACY_USERNAME: ${{ secrets.CODACY_USERNAME }}
CODACY_PROJECT_NAME: ${{ secrets.CODACY_PROJECT_NAME }}
CODACY_API_TOKEN: ${{ secrets.CODACY_API_TOKEN }}
run: |
bash <(curl -Ls https://coverage.codacy.com/get.sh) report $(find . -name '*.opencover.xml' -printf '-r %p ')