From 5634e105fb937fd770cba792dfb89c645a1d3418 Mon Sep 17 00:00:00 2001 From: Paul Koch Date: Sat, 27 Jul 2024 00:44:44 -0700 Subject: [PATCH] add bdist tests to github CI --- .github/workflows/ci.yml | 96 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a91d7cb5a..dafb3bf85 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -349,6 +349,7 @@ jobs: - name: pytest (non-win) if: ${{ !startsWith(matrix.image, 'windows') }} run: | + python -m pip install --upgrade pip setuptools wheel install_file=$(echo bld/sdist/interpret_core-*.tar.gz) install_file=$(basename "$install_file" .tar.gz) python -m pip install "bld/sdist/$install_file.tar.gz[debug,notebook,plotly,lime,sensitivity,shap,linear,treeinterpreter,aplr,dash,skoperules,testing]" @@ -359,6 +360,7 @@ jobs: - name: pytest (win) if: ${{ startsWith(matrix.image, 'windows') }} run: | + python -m pip install --upgrade pip setuptools wheel $install_file = Get-ChildItem -Path "bld/sdist" -Filter "interpret_core-*.tar.gz" $install_file = $install_file.Name -replace '\.tar\.gz$', '' $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin' @@ -383,3 +385,97 @@ jobs: flags: sdist_${{ matrix.name }} name: codecov_sdist_${{ matrix.name }} token: ${{ secrets.CODECOV_TOKEN }} + + testB: + needs: [bdist] + strategy: + matrix: + include: + - name: linux_39_python + python_ver: "3.9" + image: ubuntu-latest + - name: linux_310_python + python_ver: "3.10" + image: ubuntu-latest + - name: linux_311_python + python_ver: "3.11" + image: ubuntu-latest + - name: linux_312_python + python_ver: "3.12" + image: ubuntu-latest + - name: mac_39_python + python_ver: "3.9" + image: macos-latest + - name: mac_310_python + python_ver: "3.10" + image: macos-latest + - name: mac_311_python + python_ver: "3.11" + image: macos-latest + - name: mac_312_python + python_ver: "3.12" + image: macos-latest + - name: win_39_python + python_ver: "3.9" + image: windows-latest + - name: win_310_python + python_ver: "3.10" + image: windows-latest + - name: win_311_python + python_ver: "3.11" + image: windows-latest + - name: win_312_python + python_ver: "3.12" + image: windows-latest + runs-on: ${{ matrix.image }} + steps: + - name: Check out repo + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python_ver }} + - name: Download bdist artifact + uses: actions/download-artifact@v4 + with: + name: bdist + path: bld/bdist + - name: pytest (non-win) + if: ${{ !startsWith(matrix.image, 'windows') }} + run: | + python -m pip install --upgrade pip setuptools wheel + install_file=$(echo bld/bdist/interpret_core-*.whl) + install_file=$(basename "$install_file" .whl) + python -m pip install "bld/bdist/$install_file.whl[debug,notebook,plotly,lime,sensitivity,shap,linear,treeinterpreter,aplr,dash,skoperules,testing]" + mkdir -p "tmp/zqmr/t" + cp -R "python/interpret-core/tests/" "tmp/zqmr/t/" + cd "tmp/zqmr/t" + python -m pytest -vv -n auto --junitxml=junit/test-results.xml --cov=interpret --cov-report=xml --cov-report=html + - name: pytest (win) + if: ${{ startsWith(matrix.image, 'windows') }} + run: | + python -m pip install --upgrade pip setuptools wheel + $install_file = Get-ChildItem -Path "bld/bdist" -Filter "interpret_core-*.whl" + $install_file = $install_file.Name -replace '\.whl$', '' + $env:PATH += ';C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin' + python -m pip install "bld/bdist/$install_file.whl[debug,notebook,plotly,lime,sensitivity,shap,linear,treeinterpreter,aplr,dash,skoperules,testing]" + New-Item -Path "tmp/zqmr/t" -ItemType Directory -Force + xcopy /E "python\interpret-core\tests\*" "tmp\zqmr\t\" + cd "tmp/zqmr/t" + $env:PATH += ";$env:GeckoWebDriver" + python -m pytest -vv -n auto --junitxml=junit/test-results.xml --cov=interpret --cov-report=xml --cov-report=html + - name: Test report + if: always() + uses: dorny/test-reporter@v1 + with: + name: TestRB ${{ matrix.name }} + path: tmp/zqmr/t/junit/test-results.xml + reporter: java-junit + - name: Code coverage report + if: always() + uses: codecov/codecov-action@v4 + with: + files: tmp/zqmr/t/coverage.xml + flags: bdist_${{ matrix.name }} + name: codecov_bdist_${{ matrix.name }} + token: ${{ secrets.CODECOV_TOKEN }}