forked from fairlearn/fairlearn
-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (66 loc) · 2.15 KB
/
test-other-ml.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
name: test-other-ml
on:
workflow_call:
inputs:
os:
required: true
type: string
python:
required: true
type: string
mlpackage:
required: true
type: string
jobs:
other-ml:
runs-on: ${{ inputs.os }}
env:
baseDir: test_othermlpackages
condaEnv: test-conda-env
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python }}
- run: |
conda update -n base -c defaults conda
name: Update and initialise conda
- run: |
conda env create --name $condaEnv --file=$baseDir/conda-${{inputs.mlpackage}}.yaml
name: Create conda environment
- run: |
if [[ ${{ inputs.mlpackage }} == "tensorflow" ]]; then
export NUMPY_DEP="numpy<2"
else
export NUMPY_DEP="numpy"
fi
if [[ ${{ inputs.mlpackage }} == "lightgbm" ]]; then
export NUMPY_DEP="numpy<2"
else
export NUMPY_DEP="numpy"
fi
# For some reason, 'conda init bash' doesn't stick so
# We have to keep doing the following
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate $condaEnv
pip install . $NUMPY_DEP
name: Install Fairlearn
- run: |
source /usr/share/miniconda/etc/profile.d/conda.sh
conda activate $condaEnv
echo
conda list
echo
# Override the filterwarnings set in the TOML file
python -v -m pytest -o filterwarnings=default --cov=fairlearn --cov-report=xml $baseDir/test_${{inputs.mlpackage}}.py
name: Run ${{matrix.mlpackage}} tests
- name: Upload coverage reports to Codecov with GitHub Action
if: ${{ (inputs.codeCovPython == inputs.python) && (steps.get_date.outputs.AGE < 172800) }} # 172800 = 48 * 3600
uses: codecov/[email protected]
with:
env_vars: OS,PYTHON
fail_ci_if_error: true
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
verbose: true