Skip to content

[DEVOPS-131] Replacing repository action scanner #30

[DEVOPS-131] Replacing repository action scanner

[DEVOPS-131] Replacing repository action scanner #30

# SPDX-License-Identifier: Apache-2.0
# Licensed to the Ed-Fi Alliance under one or more agreements.
# The Ed-Fi Alliance licenses this file to you under the Apache License, Version 2.0.
# See the LICENSE and NOTICES files in the project root for more information.
name: On Pull Request - PowerShell
on:
pull_request:
branches:
- main
paths:
- "**/*.ps1"
- "**/*.psm1"
- "**/analyze-repository.yml"
- "**/powershell-analyzer.yml"
workflow_dispatch:
jobs:
run-lint:
name: Linter
uses: Ed-Fi-Alliance-OSS/Ed-Fi-Actions/.github/workflows/powershell-analyzer.yml@main
run-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout the Actions repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Run Unit Tests
shell: pwsh
working-directory: powershell-analyzer
run: |
$PesterConfig = New-PesterConfiguration
$PesterConfig.TestResult.OutputFormat = "JUnitXml"
$PesterConfig.TestResult.OutputPath = "ps-analyzer.xml"
$PesterConfig.TestResult.Enabled = $True
Invoke-Pester -Configuration $PesterConfig
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Test Results
path: powershell-analyzer/ps-analyzer.xml
event_file:
name: Upload Event File
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: Event File
path: ${{ github.event_path }}