Skip to content

Commit

Permalink
Merge pull request #21 from flcdrg/add-no-build
Browse files Browse the repository at this point in the history
Add no_build parameter
  • Loading branch information
ebekker authored May 29, 2021
2 parents 237826d + 5d74043 commit b6f063e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ jobs:
gist_badge_label: 'XUnit Tests: %Counters_passed%/%Counters_total%'
gist_token: ${{ secrets.GIST_TOKEN }}

- name: use this action, xunit project dir no restore no build
if: ${{ !cancelled() }}
id: testAction3a1
uses: ./
with:
project_path: tests/samples.xunit/AssertExamples
report_name: tests_1_xunit-norestore-nobuild-${{ matrix.os }}
report_title: Sample XUnit Tests without build or restore (${{ matrix.os }})
github_token: ${{ secrets.GITHUB_TOKEN }}
no_restore: true
no_build: true

- name: use this action, xunit project dir, ALTERNATE XSL
if: ${{ !cancelled() }}
id: testAction3a2
Expand Down
6 changes: 6 additions & 0 deletions action.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ $inputs = @{
test_results_path = Get-ActionInput test_results_path
project_path = Get-ActionInput project_path
no_restore = Get-ActionInput no_restore
no_build = Get-ActionInput no_build
msbuild_configuration = Get-ActionInput msbuild_configuration
msbuild_verbosity = Get-ActionInput msbuild_verbosity
report_name = Get-ActionInput report_name
Expand Down Expand Up @@ -277,6 +278,7 @@ else {
$test_results_path = Join-Path $tmpDir $trxName

$no_restore = $inputs.no_restore
$no_build = $inputs.no_build
$msbuild_configuration = $inputs.msbuild_configuration
$msbuild_verbosity = $inputs.msbuild_verbosity

Expand All @@ -300,6 +302,10 @@ else {
$dotnetArgs += '--no-restore'
}

if ($no_build -eq 'true') {
$dotnetArgs += '--no-build'
}

if ($inputs.extra_test_parameters) {
# we need to add the extra parameters to the array @dotnetArgs
$dotnetArgs += $inputs.extra_test_parameters -split ' '
Expand Down
7 changes: 7 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ inputs:
project before building.
required: false

no_build:
description:
When executing the unit tests against the `project_path`,
if this input parameter is `true`, do not build the
project before executing tests.
required: false

msbuild_configuration:
description:
When executing the unit tests against the `project_path`,
Expand Down

0 comments on commit b6f063e

Please sign in to comment.