-
Notifications
You must be signed in to change notification settings - Fork 8
44 lines (39 loc) · 1.39 KB
/
onPush.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
39
40
41
42
43
44
name: Run tests
on: push
jobs:
build:
name: Run tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run the tests
run: |
. ./cd-extras/public/_Classes.ps1
md ./_reports
Import-Module Pester
Invoke-Pester ./tests/cd-extras.Tests.ps1 -EnableExit -CodeCoverage ./cd-extras/private/*.ps1,./cd-extras/public/*.ps1 -CodeCoverageOutputFile ./_reports/coverage.xml -OutputFile ./_reports/testresults.xml
shell: pwsh
# run the tests again on WIndows, this time in PowerShell v5
- name: Run the tests (Powershell v5)
if: matrix.os == 'windows-latest'
run: |
. ./cd-extras/public/_Classes.ps1
md ./_reports -ea Ignore
Import-Module Pester
Invoke-Pester ./tests/cd-extras.Tests.ps1 -EnableExit -OutputFile ./_reports/testresults_powershell.xml
shell: powershell
- name: Upload test report
uses: actions/upload-artifact@master
with:
name: Test Report (${{ matrix.os }})
path: _reports
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./_reports/coverage.xml
flags: ${{ runner.os }}