mirror of
https://github.com/pyTooling/Actions.git
synced 2026-02-12 02:56:56 +08:00
Added root directory.
This commit is contained in:
18
.github/workflows/ApplicationTesting.yml
vendored
18
.github/workflows/ApplicationTesting.yml
vendored
@@ -49,11 +49,16 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
tests_directory:
|
root_directory:
|
||||||
description: 'Path to the directory containing tests (test working directory).'
|
description: 'Working directory for running tests.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
tests_directory:
|
||||||
|
description: 'Path to the directory containing tests (relative to root_directory).'
|
||||||
|
required: false
|
||||||
|
default: 'tests'
|
||||||
|
type: string
|
||||||
apptest_directory:
|
apptest_directory:
|
||||||
description: 'Path to the directory containing application tests (relative to tests_directory).'
|
description: 'Path to the directory containing application tests (relative to tests_directory).'
|
||||||
required: false
|
required: false
|
||||||
@@ -66,7 +71,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
ApplicationTesting:
|
ApplicationTesting:
|
||||||
name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Application Tests using Python ${{ matrix.python }}
|
name: ${{ matrix.sysicon }} ${{ matrix.pyicon }} Application Tests using Python ${{ matrix.python }}
|
||||||
runs-on: ${{ matrix.runs-on }}
|
runs-on: ${{ matrix.runs-on }}
|
||||||
@@ -207,7 +211,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
||||||
|
|
||||||
cd "${{ inputs.tests_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
[ -n '${{ inputs.apptest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
[ -n '${{ inputs.apptest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
||||||
if [ -n '${{ inputs.coverage_config }}' ]; then
|
if [ -n '${{ inputs.coverage_config }}' ]; then
|
||||||
echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
||||||
@@ -222,7 +226,7 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
||||||
|
|
||||||
cd "${{ inputs.tests_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
$PYTEST_ARGS = if ("${{ inputs.apptest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" }
|
$PYTEST_ARGS = if ("${{ inputs.apptest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" }
|
||||||
if ("${{ inputs.coverage_config }}") {
|
if ("${{ inputs.coverage_config }}") {
|
||||||
Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.apptest_directory }}"
|
||||||
@@ -236,7 +240,7 @@ jobs:
|
|||||||
if: inputs.apptest_xml_artifact != ''
|
if: inputs.apptest_xml_artifact != ''
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.apptest_xml_artifact }}-${{ matrix.system }}-${{ matrix.python }}
|
name: ${{ inputs.apptest_xml_artifact }}-${{ matrix.system }}-${{ matrix.runtime }}-${{ matrix.python }}
|
||||||
path: ${{ inputs.tests_directory || '.' }}/TestReportSummary.xml
|
path: report/unit/TestReportSummary.xml
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|||||||
13
.github/workflows/UnitTesting.yml
vendored
13
.github/workflows/UnitTesting.yml
vendored
@@ -44,11 +44,16 @@ on:
|
|||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
tests_directory:
|
root_directory:
|
||||||
description: 'Path to the directory containing tests (test working directory).'
|
description: 'Working directory for running tests.'
|
||||||
required: false
|
required: false
|
||||||
default: ''
|
default: ''
|
||||||
type: string
|
type: string
|
||||||
|
tests_directory:
|
||||||
|
description: 'Path to the directory containing tests (relative to root_directory).'
|
||||||
|
required: false
|
||||||
|
default: 'tests'
|
||||||
|
type: string
|
||||||
unittest_directory:
|
unittest_directory:
|
||||||
description: 'Path to the directory containing unit tests (relative to tests_directory).'
|
description: 'Path to the directory containing unit tests (relative to tests_directory).'
|
||||||
required: false
|
required: false
|
||||||
@@ -293,7 +298,7 @@ jobs:
|
|||||||
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
export ENVIRONMENT_NAME="${{ matrix.envname }}"
|
||||||
export PYTHONPATH=$(pwd)
|
export PYTHONPATH=$(pwd)
|
||||||
|
|
||||||
cd "${{ inputs.tests_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
[ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
[ -n '${{ inputs.unittest_xml_artifact }}' ] && PYTEST_ARGS='--junitxml=report/unit/TestReportSummary.xml' || unset PYTEST_ARGS
|
||||||
if [ -n '${{ inputs.coverage_config }}' ]; then
|
if [ -n '${{ inputs.coverage_config }}' ]; then
|
||||||
echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
echo "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP $PYTEST_ARGS --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
||||||
@@ -309,7 +314,7 @@ jobs:
|
|||||||
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
$env:ENVIRONMENT_NAME = "${{ matrix.envname }}"
|
||||||
$env:PYTHONPATH = (Get-Location).ToString()
|
$env:PYTHONPATH = (Get-Location).ToString()
|
||||||
|
|
||||||
cd "${{ inputs.tests_directory || '.' }}"
|
cd "${{ inputs.root_directory || '.' }}"
|
||||||
$PYTEST_ARGS = if ("${{ inputs.unittest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" }
|
$PYTEST_ARGS = if ("${{ inputs.unittest_xml_artifact }}") { "--junitxml=report/unit/TestReportSummary.xml" } else { "" }
|
||||||
if ("${{ inputs.coverage_config }}") {
|
if ("${{ inputs.coverage_config }}") {
|
||||||
Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
Write-Host "coverage run --data-file=.coverage --rcfile=pyproject.toml -m pytest -raP --color=yes ${{ inputs.tests_directory || '.' }}/${{ inputs.unittest_directory }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user