workflows/test: factor out steps & refactoring

This commit is contained in:
Egor Tensin 2021-07-02 20:16:57 +03:00
parent 4785090c89
commit 3d49180b0b
6 changed files with 153 additions and 95 deletions

26
.github/actions/run-foo/action.yml vendored Normal file
View file

@ -0,0 +1,26 @@
name: Run foo.exe
description: Run foo.exe and verify its output
runs:
using: composite
steps:
- run: |
$expected = @"
Doing something #1
Doing something #2
Doing something #3
"@
$actual = & (Join-Path . foo.exe)
$actual = $actual -join [Environment]::NewLine
echo @"
Expected output:
$expected
"@
echo @"
Actual output:
$actual
"@
$($actual -eq $expected) -or $(throw "Unexpected output!")
shell: pwsh