Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added CodeQL Tasks to Build Pipelines #289

Merged
merged 5 commits into from
Aug 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,35 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Setup .NET Core SDK ${{ matrix.dotnet-version }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: ${{ matrix.dotnet-version }}

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: csharp, javascript

- name: Install dependencies
run: |
cd src
dotnet restore

- name: Build
run: |
cd src
dotnet build --configuration Release --no-restore

- name: Test
run: |
cd src
dotnet test --no-restore --verbosity normal --logger:trx --collect:"XPlat Code Coverage" --results-directory ./TestResults

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2

- name: Test Report
uses: dorny/test-reporter@v1
if: success() || failure() # run this step even if previous step failed
Expand All @@ -44,8 +57,10 @@ jobs:
path: |
**/*.trx
reporter: dotnet-trx # Format of test results

- name: Copy Coverage report
run: cp src/TestResults/**/coverage.cobertura.xml coverage.cobertura.xml

- name: Code coverage report
uses: irongut/[email protected]
with:
Expand All @@ -56,12 +71,14 @@ jobs:
indicators: true
output: both
thresholds: '85 90'

- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
recreate: true
path: code-coverage-results.md

yaml-integration-tests-prod:
needs: build
uses: ./.github/workflows/yaml-integration-tests.yml
Expand All @@ -78,6 +95,7 @@ jobs:
{ "environmentId": "ceb95cca-da1d-ed58-8af8-117cb4081f16", "tenantId": "f2c52b3d-d88e-4892-9785-d5b7c7016725", "domain": "apps.powerapps.com", "testPlanFile": "../../samples/nestedgallery/testPlan.fx.yaml", "outputDirectory": "../../TestResults" },
{ "environmentId": "ceb95cca-da1d-ed58-8af8-117cb4081f16", "tenantId": "f2c52b3d-d88e-4892-9785-d5b7c7016725", "domain": "apps.powerapps.com", "testPlanFile": "../../samples/pcfcomponent/testPlan.fx.yaml", "outputDirectory": "../../TestResults" }]'
secrets: inherit

yaml-integration-tests-preprod:
needs: build
uses: ./.github/workflows/yaml-integration-tests.yml
Expand Down Expand Up @@ -105,4 +123,4 @@ jobs:
uses: thechetantalwar/teams-notify@v2
with:
teams_webhook_url: ${{ secrets.TEAM_HOOK }}
message: "${{ job.status }}: Github Action ${{ github.run_number }} (attempt #${{ github.run_attempt }}) triggered by ${{ github.triggering_actor }}. See https://github.com/microsoft/PowerApps-TestEngine/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }} details."
message: "${{ job.status }}: Github Action ${{ github.run_number }} (attempt #${{ github.run_attempt }}) triggered by ${{ github.triggering_actor }}. See https://github.com/microsoft/PowerApps-TestEngine/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }} details."
7 changes: 7 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ pr: none
pool:
vmImage: 'windows-latest'

variables:
Codeql.Enabled: true

jobs:
- job: Build_PowerAppsTestEngine
displayName: 'Build PowerAppsTestEngine Solution'
Expand All @@ -29,13 +32,17 @@ jobs:
version: 6.0.x
installationPath: '$(Agent.ToolsDirectory)/dotnet'

- task: CodeQL3000Init@0

- task: DotNetCoreCLI@2
displayName: 'Build and test'
inputs:
command: 'run'
projects: '$(Build.SourcesDirectory)/targets/targets.csproj'
arguments: '-- ci -c $(BuildConfiguration)'

- task: CodeQL3000Finalize@0

- task: PublishTestResults@2
inputs:
testResultsFormat: 'VSTest'
Expand Down
Loading