@@ -493,10 +493,12 @@ jobs:
493
493
- name : Cache array API tests
494
494
id : cache-array-api-tests
495
495
uses : actions/cache@v3
496
+ env :
497
+ ARRAY_CACHE : 3
496
498
with :
497
499
path : |
498
- /home/runner/work/array-api-tests-08-19-22 /
499
- key : ${{ runner.os }}-build- ${{ env.cache-name }}-${{ hashFiles('/home/runner/work/array-api-tests-08-19-22 /requirements.txt') }}
500
+ /home/runner/work/array-api-tests/
501
+ key : ${{ runner.os }}-array-api- ${{ env.cache-name }}-{{ env.ARRAY_CACHE }}- ${{ hashFiles('/home/runner/work/array-api-tests/requirements.txt') }}
500
502
restore-keys : |
501
503
${{ runner.os }}-build-${{ env.cache-name }}-
502
504
${{ runner.os }}-build-
@@ -506,16 +508,16 @@ jobs:
506
508
shell : bash -l {0}
507
509
run : |
508
510
cd /home/runner/work
509
- git clone --recurse-submodules https://github.com/data-apis/array-api-tests array-api-tests-08-19-22
510
- cd array-api-tests-08-19-22
511
- git checkout 66ab89c097d98f876e3c62f72e854ddb7d327f2e
511
+ git clone --recurse-submodules https://github.com/data-apis/array-api-tests array-api-tests
512
+ cd array-api-tests
512
513
- name : Download artifact
513
514
uses : actions/download-artifact@v2
514
515
with :
515
516
name : ${{ env.PACKAGE_NAME }} ${{ runner.os }} Python ${{ matrix.python }}
516
517
- name : Add conda to system path
517
518
run : echo $CONDA/bin >> $GITHUB_PATH
518
519
- name : Install conda-build
520
+ # Needed to be able to run conda index
519
521
run : conda install conda-build
520
522
- name : Create conda channel
521
523
run : |
@@ -530,15 +532,15 @@ jobs:
530
532
run : |
531
533
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
532
534
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
533
- conda install $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
535
+ conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} python=${{ matrix.python }} $CHANNELS --only-deps --dry-run > lockfile
534
536
cat lockfile
535
537
- name : Set pkgs_dirs
536
538
run : |
537
539
echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc
538
540
- name : Cache conda packages
539
541
uses : actions/cache@v3
540
542
env :
541
- CACHE_NUMBER : 1 # Increase to reset cache
543
+ CACHE_NUMBER : 3 # Increase to reset cache
542
544
with :
543
545
path : ~/.conda/pkgs
544
546
key :
@@ -550,43 +552,58 @@ jobs:
550
552
run : |
551
553
CHANNELS="-c $GITHUB_WORKSPACE/channel ${{ env.CHANNELS }}"
552
554
export PACKAGE_VERSION=$(python -c "${VER_SCRIPT1} ${VER_SCRIPT2}")
553
- conda install $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
555
+ conda create -n test_dpctl $PACKAGE_NAME=${PACKAGE_VERSION} pytest python=${{ matrix.python }} $CHANNELS
554
556
# Test installed packages
555
557
conda list
556
558
- name : Install array API test dependencies
557
559
shell : bash -l {0}
558
560
run : |
559
- cd /home/runner/work/array-api-tests-08-19-22
561
+ . $CONDA/etc/profile.d/conda.sh
562
+ conda activate test_dpctl
563
+ cd /home/runner/work/array-api-tests
560
564
pip install -r requirements.txt
561
565
- name : Install jq
562
566
shell : bash -l {0}
563
567
run : |
564
568
sudo apt-get install jq
565
- - name : Array API conformity tests
569
+ - name : Run array API conformance tests
570
+ id : run-array-api-tests
566
571
shell : bash -l {0}
567
572
run : |
573
+ FILE=/home/runner/work/.report.json
574
+ . $CONDA/etc/profile.d/conda.sh
575
+ conda activate test_dpctl
576
+ # echo "libintelocl.so" | tee /etc/OpenCL/vendors/intel-cpu.icd
577
+ export OCL_ICD_FILENAMES=libintelocl.so
568
578
export SYCL_ENABLE_HOST_DEVICE=1
569
579
python -c "import dpctl; dpctl.lsplatform()"
570
580
export ARRAY_API_TESTS_MODULE=dpctl.tensor
571
- cd /home/runner/work/array-api-tests-08-19-22
572
- pytest --ci --json-report array_api_tests/
581
+ cd /home/runner/work/array-api-tests
582
+ pytest --ci --json-report --json-report-file=$FILE array_api_tests/ || true
573
583
- name : Set Github environment variables
574
584
shell : bash -l {0}
575
585
run : |
576
- PASSED_TESTS=$(jq '.summary | .passed // 0' ~/array-api-tests-08-19-22/.report.json)
577
- echo "PASSED=$PASSED_TESTS" >> $
578
- FAILED_TESTS=$(jq '.summary | .failed // 0' ~/array-api-tests-08-19-22/.report.json)
579
- echo "FAILED=$FAILED_TESTS" >> $GITHUB_ENV
580
- SKIPPED_TESTS=$(jq '.summary | .skipped // 0' ~/array-api-tests-08-19-22/.report.json)
581
- echo "SKIPPED=$SKIPPED_TESTS" >> $GITHUB_ENV
586
+ FILE=/home/runner/work/.report.json
587
+ if test -f "$FILE"; then
588
+ PASSED_TESTS=$(jq '.summary | .passed // 0' $FILE)
589
+ FAILED_TESTS=$(jq '.summary | .failed // 0' $FILE)
590
+ SKIPPED_TESTS=$(jq '.summary | .skipped // 0' $FILE)
591
+ MESSAGE="Array API standard conformance tests ran successfully.
592
+ Passed: $PASSED_TESTS
593
+ Failed: $FAILED_TESTS
594
+ Skipped: $SKIPPED_TESTS"
595
+ echo "MESSAGE<<EOF" >> $GITHUB_ENV
596
+ echo "$MESSAGE" >> $GITHUB_ENV
597
+ echo "EOF" >> $GITHUB_ENV
598
+ else
599
+ MESSAGE=$'Array API standard conformance tests failed to run.'
600
+ echo "MESSAGE=$MESSAGE" >> $GITHUB_ENV
601
+ fi
582
602
- name : Post result to PR
583
603
uses : mshick/add-pr-comment@v1
584
604
with :
585
605
message : |
586
- Array API standard conformance test ran successfully.
587
- Passed: ${{ env.PASSED }}
588
- Failed: ${{ env.FAILED }}
589
- Skipped: ${{ env.SKIPPED }}
590
- allow-repeats : false
606
+ ${{ env.MESSAGE }}
607
+ allow-repeats : true
591
608
repo-token : ${{ secrets.GITHUB_TOKEN }}
592
609
repo-token-user-login : ' github-actions[bot]'
0 commit comments