diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..d57d1e5 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,20 @@ +name: Linting + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + lint: + name: Run PS Script Analyzer + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: lint + uses: devblackops/github-action-psscriptanalyzer@master + with: + failOnErrors: true + failOnWarnings: false + failOnInfos: false diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..f43f997 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,42 @@ +name: Unit tests + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + test-pwsh: + defaults: + run: + shell: pwsh + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v3.1.0 + + - name: Run Pester Tests (pwsh) + run: | + Write-Output $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor + Set-PSRepository psgallery -InstallationPolicy trusted + Install-Module -Name Pester -Confirm:$false -Force + Invoke-Pester -Path "./tests" -EnableExit -Show All + + test-powershell: + runs-on: windows-latest + steps: + - name: Checkout + uses: actions/checkout@v3.1.0 + + - name: Run Pester Tests (powershell) + shell: powershell + run: | + Write-Output $PSVersionTable.PSVersion.Major $PSVersionTable.PSRemotingProtocolVersion.Minor + Set-PSRepository psgallery -InstallationPolicy trusted + Install-Module -Name Pester -Confirm:$false -Force + Invoke-Pester -Path "./tests" -Show All