Skip to content

update UI to support genai task for RAI text dashboard (#2504) (#2508) #4571

update UI to support genai task for RAI text dashboard (#2504) (#2508)

update UI to support genai task for RAI text dashboard (#2504) (#2508) #4571

name: CI RAIWidgets pytest
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
ci-raiwidgets-pytest:
env:
node-version: 16.x
strategy:
# keep running remaining matrix jobs even if one fails
# to avoid having to rerun all jobs several times
fail-fast: false
matrix:
packageDirectory: ["raiwidgets"]
operatingSystem: [ubuntu-latest, macos-latest, windows-latest]
pythonVersion: [3.7, 3.8, 3.9, "3.10"]
exclude:
- packageDirectory: "raiwidgets"
operatingSystem: macos-latest
pythonVersion: 3.9
- packageDirectory: "raiwidgets"
operatingSystem: windows-latest
pythonVersion: 3.8
runs-on: ${{ matrix.operatingSystem }}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.pythonVersion }}
- name: Use Node.js ${{ env.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.node-version }}
- name: Install yarn
run: npm install yarn -g
- name: Install yarn dependencies
run: yarn install --frozen-lock-file
- name: Build Typescript
run: yarn buildall
- if: ${{ matrix.operatingSystem == 'macos-latest' }}
name: Install latest numpy from conda-forge for MacOS
shell: bash -l {0}
run: |
conda install --yes --quiet -c conda-forge numpy
- if: ${{ matrix.operatingSystem == 'macos-latest' }}
name: Install latest lightgbm from conda-forge for MacOS
shell: bash -l {0}
run: |
conda install --yes --quiet lightgbm -c conda-forge
- name: Setup tools
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade "pip-tools<=7.1.0"
- name: Install dependencies
shell: bash -l {0}
run: |
pip install -r requirements-dev.txt --ignore-installed
pip install -v -e .
working-directory: ${{ matrix.packageDirectory }}
- name: Pip freeze
shell: bash -l {0}
run: |
pip freeze > installed-requirements-dev.txt
cat installed-requirements-dev.txt
working-directory: ${{ matrix.packageDirectory }}
- name: Upload requirements
uses: actions/upload-artifact@v3
with:
name: requirements-dev.txt
path: ${{ matrix.packageDirectory }}/installed-requirements-dev.txt
- name: Run tests
shell: bash -l {0}
id: raiwidgettests
run: |
pytest -s -v --durations=10 --junitxml=junit/test-results.xml --cov=${{ matrix.packageDirectory }} --cov-report=xml --cov-report=html
working-directory: ${{ matrix.packageDirectory }}
- if: ${{ (steps.raiwidgettests.outcome == 'success') }}
name: Upload code coverage results
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.packageDirectory }}-code-coverage-results
path: ${{ matrix.packageDirectory }}/htmlcov
- if: ${{ (matrix.operatingSystem == 'windows-latest') && (matrix.pythonVersion == '3.8') }}
name: Upload to codecov
id: codecovupload1
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ matrix.packageDirectory }}
env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./${{ matrix.packageDirectory }}/coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true
- if: ${{ (steps.codecovupload1.outcome == 'failure') && (matrix.pythonVersion == '3.8') && (matrix.operatingSystem == 'windows-latest') }}
name: Retry upload to codecov
id: codecovupload2
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: ${{ matrix.packageDirectory }}
env_vars: OS,PYTHON
fail_ci_if_error: false
files: ./${{ matrix.packageDirectory }}/coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true
- name: Set codecov status
if: ${{ (matrix.pythonVersion == '3.8') && (matrix.operatingSystem == 'windows-latest') }}
shell: bash
run: |
if ${{ (steps.codecovupload1.outcome == 'success') || (steps.codecovupload2.outcome == 'success') }} ; then
echo fine
else
exit 1
fi