30
30
extra-env-vars :
31
31
required : false
32
32
type : string
33
- description : ' Extra environment variables to set during the test run'
33
+ description : " Multiline string of environment variables to set for the test run. "
34
34
35
35
env :
36
36
PYTEST_ARGS : " --max-examples 200 -v -rxXfE --ci ${{ inputs.pytest-extra-args }} --hypothesis-disable-deadline"
@@ -41,38 +41,43 @@ jobs:
41
41
strategy :
42
42
matrix :
43
43
python-version : ['3.9', '3.10', '3.11', '3.12']
44
+
44
45
steps :
45
- - name : Checkout array-api-compat
46
- uses : actions/checkout@v4
47
- with :
48
- path : array-api-compat
49
- - name : Checkout array-api-tests
50
- uses : actions/checkout@v4
51
- with :
52
- repository : data-apis/array-api-tests
53
- submodules : ' true'
54
- path : array-api-tests
55
- - name : Set up Python ${{ matrix.python-version }}
56
- uses : actions/setup-python@v5
57
- with :
58
- python-version : ${{ matrix.python-version }}
59
- - name : Install dependencies
60
- # NumPy 1.21 doesn't support Python 3.11. There doesn't seem to be a way
61
- # to put this in the numpy 1.21 config file.
62
- if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
63
- run : |
64
- python -m pip install --upgrade pip
65
- python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }}
66
- python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
67
- - name : Run the array API testsuite (${{ inputs.package-name }})
68
- if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
69
- env :
70
- ARRAY_API_TESTS_MODULE : array_api_compat.${{ inputs.module-name || inputs.package-name }}
71
- # This enables the NEP 50 type promotion behavior (without it a lot of
72
- # tests fail on bad scalar type promotion behavior)
73
- NPY_PROMOTION_STATE : weak
74
- ${{ inputs.extra-env-vars }}
75
- run : |
76
- export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
77
- cd ${GITHUB_WORKSPACE}/array-api-tests
78
- pytest array_api_tests/ --xfails-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.xfails-file-extra }}-xfails.txt --skips-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.skips-file-extra}}-skips.txt ${PYTEST_ARGS}
46
+ - name : Checkout array-api-compat
47
+ uses : actions/checkout@v4
48
+ with :
49
+ path : array-api-compat
50
+ - name : Checkout array-api-tests
51
+ uses : actions/checkout@v4
52
+ with :
53
+ repository : data-apis/array-api-tests
54
+ submodules : ' true'
55
+ path : array-api-tests
56
+ - name : Set up Python ${{ matrix.python-version }}
57
+ uses : actions/setup-python@v5
58
+ with :
59
+ python-version : ${{ matrix.python-version }}
60
+ - name : Set Extra Environment Variables
61
+ # Set additional environment variables if provided
62
+ if : inputs.extra-env-vars
63
+ run : |
64
+ echo "${{ inputs.extra-env-vars }}" >> $GITHUB_ENV
65
+ - name : Install dependencies
66
+ # NumPy 1.21 doesn't support Python 3.11. There doesn't seem to be a way
67
+ # to put this in the numpy 1.21 config file.
68
+ if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
69
+ run : |
70
+ python -m pip install --upgrade pip
71
+ python -m pip install '${{ inputs.package-name }} ${{ inputs.package-version }}' ${{ inputs.extra-requires }}
72
+ python -m pip install -r ${GITHUB_WORKSPACE}/array-api-tests/requirements.txt
73
+ - name : Run the array API testsuite (${{ inputs.package-name }})
74
+ if : " ! ((matrix.python-version == '3.11' || matrix.python-version == '3.12') && inputs.package-name == 'numpy' && contains(inputs.package-version, '1.21'))"
75
+ env :
76
+ ARRAY_API_TESTS_MODULE : array_api_compat.${{ inputs.module-name || inputs.package-name }}
77
+ # This enables the NEP 50 type promotion behavior (without it a lot of
78
+ # tests fail on bad scalar type promotion behavior)
79
+ NPY_PROMOTION_STATE : weak
80
+ run : |
81
+ export PYTHONPATH="${GITHUB_WORKSPACE}/array-api-compat"
82
+ cd ${GITHUB_WORKSPACE}/array-api-tests
83
+ pytest array_api_tests/ --xfails-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.xfails-file-extra }}-xfails.txt --skips-file ${GITHUB_WORKSPACE}/array-api-compat/${{ inputs.package-name }}${{ inputs.skips-file-extra}}-skips.txt ${PYTEST_ARGS}
0 commit comments