Skip to content

Commit

Permalink
simplify ci matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
brettfo committed Apr 17, 2020
1 parent a9752de commit 467aa35
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 28 deletions.
25 changes: 8 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,19 @@ on: [push, pull_request]

jobs:

linux:
runs-on: ubuntu-latest
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
configuration: ['Debug', 'Release']
os: [ubuntu-latest, windows-latest]
configuration: [Debug, Release]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.201'
- name: Build and test
run: ./build-and-test.sh --configuration ${{ matrix.configuration }}

windows:
runs-on: windows-latest
strategy:
matrix:
configuration: ['Debug', 'Release']
steps:
- uses: actions/checkout@v1
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.201'
- name: Build and test
run: .\build-and-test.cmd -c ${{ matrix.configuration }}
shell: pwsh
run: |
$shellExt = if ($IsWindows) { "cmd" } else { "sh" }
& ./build-and-test.$shellExt --configuration ${{ matrix.configuration }}
26 changes: 15 additions & 11 deletions build-and-test.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,25 @@ set runtests=true

:parseargs
if "%1" == "" goto argsdone
if /i "%1" == "-c" (
set configuration=%2
shift
shift
goto parseargs
)
if /i "%1" == "-notest" (
set runtests=false
shift
goto parseargs
)
if /i "%1" == "-c" goto set_configuration
if /i "%1" == "--configuration" goto set_configuration
if /i "%1" == "-notest" goto set_notest
if /i "%1" == "--notest" goto set_notest

echo Unsupported argument: %1
goto error

:set_configuration
set configuration=%2
shift
shift
goto parseargs

:set_notest
set runtests=false
shift
goto parseargs

:argsdone

:: build
Expand Down

0 comments on commit 467aa35

Please sign in to comment.