Signed-off-by: Keith Battocchi <kebatt@microsoft.com>
This commit is contained in:
Keith Battocchi 2023-08-13 21:28:51 -04:00 коммит произвёл Keith Battocchi
Родитель 53e70081b4
Коммит 6c0848f1e6
3 изменённых файлов: 47 добавлений и 9 удалений

42
.github/workflows/ci.yml поставляемый
Просмотреть файл

@ -127,6 +127,8 @@ jobs:
version: '3.9' version: '3.9'
install_graphviz: false install_graphviz: false
fail-fast: false fail-fast: false
env:
id_string: ${{ matrix.kind }}-${{ matrix.version }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
name: Checkout repository name: Checkout repository
@ -148,13 +150,13 @@ jobs:
- run: pip install jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm - run: pip install jupyter jupyter-client nbconvert nbformat seaborn xgboost tqdm
name: Install notebook requirements name: Install notebook requirements
if: ${{ !env.use_lkg }} if: ${{ !env.use_lkg }}
- run: pip freeze --exclude-editable > notebooks-${{ matrix.version }}-${{ matrix.kind }}-requirements.txt - run: pip freeze --exclude-editable > notebooks-${{ env.id_string }}-requirements.txt
name: Save installed packages name: Save installed packages
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
name: Upload installed packages name: Upload installed packages
with: with:
name: requirements name: requirements
path: notebooks-${{ matrix.version }}-${{ matrix.kind }}-requirements.txt path: notebooks-${{ env.id_string }}-requirements.txt
- run: pip install pytest pytest-runner coverage - run: pip install pytest pytest-runner coverage
name: Install pytest name: Install pytest
@ -165,7 +167,7 @@ jobs:
PYTEST_ADDOPTS: '-m "notebook"' PYTEST_ADDOPTS: '-m "notebook"'
NOTEBOOK_DIR_PATTERN: ${{ matrix.pattern }} NOTEBOOK_DIR_PATTERN: ${{ matrix.pattern }}
COVERAGE_PROCESS_START: 'setup.cfg' COVERAGE_PROCESS_START: 'setup.cfg'
- run: mv .coverage .coverage.${{ matrix.kind }} - run: mv .coverage .coverage.${{ env.id_string }}
# Run whether or not the tests passed, but only if they ran at all # Run whether or not the tests passed, but only if they ran at all
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome) if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
name: Make coverage filename unique name: Make coverage filename unique
@ -174,8 +176,18 @@ jobs:
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome) if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
with: with:
name: coverage name: coverage
path: .coverage.${{ matrix.kind }} path: .coverage.${{ env.id_string }}
- run: mv junit/test-results.xml ${{ env.id_string }}-test-results.xml
# Run whether or not the tests passed, but only if they ran at all
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
name: Make test XML filename unique
- uses: actions/upload-artifact@v3
name: Upload test XML files
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
with:
name: tests
path: ${{ env.id_string }}-test-results.xml
tests: tests:
name: "Run tests" name: "Run tests"
needs: [eval] needs: [eval]
@ -211,6 +223,8 @@ jobs:
extras: "[tf,plt]" extras: "[tf,plt]"
fail-fast: false fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
env:
id_string: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
name: Checkout repository name: Checkout repository
@ -225,13 +239,13 @@ jobs:
# Add verbose flag to pip installation if in debug mode # Add verbose flag to pip installation if in debug mode
- run: pip install -e .${{ matrix.extras }} ${{ fromJSON('["","-v"]')[runner.debug] }} ${{ env.use_lkg && '-r lkg.txt' }} - run: pip install -e .${{ matrix.extras }} ${{ fromJSON('["","-v"]')[runner.debug] }} ${{ env.use_lkg && '-r lkg.txt' }}
name: Install econml name: Install econml
- run: pip freeze --exclude-editable > tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}-requirements.txt - run: pip freeze --exclude-editable > tests-${{ env.id_string }}-requirements.txt
name: Save installed packages name: Save installed packages
- uses: actions/upload-artifact@v3 - uses: actions/upload-artifact@v3
name: Upload installed packages name: Upload installed packages
with: with:
name: requirements name: requirements
path: tests-${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }}-requirements.txt path: tests-${{ env.id_string }}-requirements.txt
- run: pip install pytest pytest-runner coverage - run: pip install pytest pytest-runner coverage
name: Install pytest name: Install pytest
- run: python setup.py pytest - run: python setup.py pytest
@ -240,7 +254,7 @@ jobs:
env: env:
PYTEST_ADDOPTS: ${{ matrix.opts }} PYTEST_ADDOPTS: ${{ matrix.opts }}
COVERAGE_PROCESS_START: 'setup.cfg' COVERAGE_PROCESS_START: 'setup.cfg'
- run: mv .coverage .coverage.${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }} - run: mv .coverage .coverage.${{ env.id_string }}
# Run whether or not the tests passed, but only if they ran at all # Run whether or not the tests passed, but only if they ran at all
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome) if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
name: Make coverage filename unique name: Make coverage filename unique
@ -249,7 +263,17 @@ jobs:
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome) if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
with: with:
name: coverage name: coverage
path: .coverage.${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.kind }} path: .coverage.${{ env.id_string }}
- run: mv junit/test-results.xml ${{ env.id_string }}-test-results.xml
# Run whether or not the tests passed, but only if they ran at all
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
name: Make test XML filename unique
- uses: actions/upload-artifact@v3
name: Upload test XML files
if: success() || failure() && contains(fromJSON('["success", "failure"]'), steps.run_tests.outcome)
with:
name: tests
path: ${{ env.id_string }}-test-results.xml
coverage-report: coverage-report:
name: "Coverage report" name: "Coverage report"

13
.github/workflows/publish-documentation.yml поставляемый
Просмотреть файл

@ -23,6 +23,11 @@ on:
required: false required: false
default: True default: True
type: boolean type: boolean
run_doctests:
description: 'Whether to run doctests'
required: false
default: True
type: boolean
# annoyingly, there does not seem to be a way to share these input definitions between triggers # annoyingly, there does not seem to be a way to share these input definitions between triggers
workflow_call: workflow_call:
inputs: inputs:
@ -47,6 +52,11 @@ on:
required: false required: false
default: True default: True
type: boolean type: boolean
run_doctests:
description: 'Whether to run doctests'
required: false
default: True
type: boolean
jobs: jobs:
create_docs: create_docs:
@ -74,6 +84,9 @@ jobs:
with: with:
name: docs name: docs
path: build/sphinx/html/ path: build/sphinx/html/
- run: python setup.py build_sphinx -b doctest
name: Run doctests
if : ${{ inputs.run_doctests }}
- run: |- - run: |-
pushd build/sphinx/html pushd build/sphinx/html
zip -r docs.zip * zip -r docs.zip *

1
.github/workflows/publish-package.yml поставляемый
Просмотреть файл

@ -55,6 +55,7 @@ jobs:
strategy: strategy:
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest] os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3