forked from microsoft/AL-Go
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (33 loc) · 1.04 KB
/
CI.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
defaults:
run:
shell: pwsh
jobs:
Test:
runs-on: [ ubuntu-latest ]
steps:
- uses: actions/checkout@v3
- name: Run Tests
run: |
. (Join-Path "." "Tests/runtests.ps1")
- name: Test AL-GO Workflows
if: github.repository_owner == 'microsoft'
run: |
try {
$errorActionPreference = "Stop"; $ProgressPreference = "SilentlyContinue"; Set-StrictMode -Version 2.0
$result = Invoke-Pester @(Get-ChildItem -Path (Join-Path "." "Tests/WorkflowSanitation/*.Test.ps1")) -passthru
if ($result.FailedCount -gt 0) {
Write-Host "::Error::$($result.FailedCount) tests are failing"
$host.SetShouldExit(1)
}
}
catch {
Write-Host "::Error::Error when running tests. The Error was $($_.Exception.Message)"
$host.SetShouldExit(1)
}