mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Adjusted writings and rebased the branch.
This commit is contained in:
10
.github/workflows/UnitTesting.yml
vendored
10
.github/workflows/UnitTesting.yml
vendored
@@ -48,13 +48,13 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
test_directory:
|
tests_directory:
|
||||||
description: 'Path to the directory containing tests (test working directory).'
|
description: 'Path to the directory containing tests (test working directory).'
|
||||||
required: false
|
required: false
|
||||||
default: 'tests'
|
default: 'tests'
|
||||||
type: string
|
type: string
|
||||||
unittest_directory:
|
unittest_directory:
|
||||||
description: 'Path to the directory containing unit tests (relative to test_directory).'
|
description: 'Path to the directory containing unit tests (relative to tests_directory).'
|
||||||
required: false
|
required: false
|
||||||
default: 'unit'
|
default: 'unit'
|
||||||
type: string
|
type: string
|
||||||
@@ -118,14 +118,14 @@ jobs:
|
|||||||
- name: ☑ Run unit tests
|
- name: ☑ Run unit tests
|
||||||
if: matrix.system == 'windows'
|
if: matrix.system == 'windows'
|
||||||
run: |
|
run: |
|
||||||
cd ${{ inputs.test_directory }}
|
cd ${{ inputs.tests_directory }}
|
||||||
$PYTEST_ARGS = if ("${{ inputs.artifact }}".length -gt 0) { "--junitxml=TestReportSummary.xml" } else { "" }
|
$PYTEST_ARGS = if ("${{ inputs.artifact }}".length -gt 0) { "--junitxml=TestReportSummary.xml" } else { "" }
|
||||||
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
|
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
|
||||||
|
|
||||||
- name: ☑ Run unit tests
|
- name: ☑ Run unit tests
|
||||||
if: matrix.system != 'windows'
|
if: matrix.system != 'windows'
|
||||||
run: |
|
run: |
|
||||||
cd ${{ inputs.test_directory }}
|
cd ${{ inputs.tests_directory }}
|
||||||
[ 'x${{ inputs.artifact }}' != 'x' ] && PYTEST_ARGS='--junitxml=TestReportSummary.xml' || unset PYTEST_ARGS
|
[ 'x${{ inputs.artifact }}' != 'x' ] && PYTEST_ARGS='--junitxml=TestReportSummary.xml' || unset PYTEST_ARGS
|
||||||
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
|
python -m pytest -rA ${{ inputs.unittest_directory }} $PYTEST_ARGS --color=yes
|
||||||
|
|
||||||
@@ -134,6 +134,6 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v2
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.artifact }}-${{ matrix.system }}-${{ matrix.python }}
|
name: ${{ inputs.artifact }}-${{ matrix.system }}-${{ matrix.python }}
|
||||||
path: ${{ inputs.test_directory }}/TestReportSummary.xml
|
path: ${{ inputs.tests_directory }}/TestReportSummary.xml
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
Reference in New Issue
Block a user