Repository navigation
build: move to scikit-build-core #6443
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Generate coverage data | |
| on: | |
| pull_request: | |
| push: | |
| branches: [master] | |
| permissions: | |
| contents: read | |
| jobs: | |
| generate-coverage: | |
| name: Generate coverage and push to Coveralls.io | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 150 | |
| permissions: | |
| pull-requests: write | |
| env: | |
| ONEAPI_ROOT: /opt/intel/oneapi | |
| GTEST_ROOT: /home/runner/work/googletest-1.15.2/install | |
| steps: | |
| - name: Cancel Previous Runs | |
| uses: styfle/cancel-workflow-action@d07a454dad7609a92316b57b23c9ccfd4f59af66 # 0.13.1 | |
| with: | |
| access_token: ${{ github.token }} | |
| - name: Add Intel repository | |
| run: | | |
| wget -qO- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB \ | |
| | gpg --dearmor | sudo tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null | |
| echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" \ | |
| | sudo tee /etc/apt/sources.list.d/oneAPI.list | |
| sudo apt update | |
| - name: Install latest Intel OneAPI | |
| run: | | |
| sudo apt install intel-oneapi-compiler-dpcpp-cpp | |
| sudo apt install intel-oneapi-tbb | |
| sudo apt install intel-oneapi-umf | |
| sudo apt install hwloc | |
| - name: Run SYCL list | |
| run: | | |
| source /opt/intel/oneapi/setvars.sh | |
| sycl-ls --verbose | |
| - name: Install CMake and Ninja | |
| run: | | |
| sudo apt-get install ninja-build | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0 | |
| with: | |
| python-version: '3.14' | |
| architecture: x64 | |
| - name: Cache Gtest | |
| id: cache-gtest | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: | | |
| /home/runner/work/googletest-1.15.2/install | |
| key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('/home/runner/work/googletest-1.15.2/install/include/gtest/*') }} | |
| restore-keys: | | |
| ${{ runner.os }}-build-${{ env.cache-name }}- | |
| ${{ runner.os }}-build- | |
| ${{ runner.os }}- | |
| - name: Install Gtest | |
| if: steps.cache-gtest.outputs.cache-hit != 'true' | |
| shell: bash -l {0} | |
| run: | | |
| cd /home/runner/work | |
| wget https://github.com/google/googletest/archive/refs/tags/v1.15.2.tar.gz | |
| tar xf v1.15.2.tar.gz | |
| cd googletest-1.15.2 | |
| mkdir build | |
| cd build | |
| cmake .. -DCMAKE_INSTALL_PREFIX=/home/runner/work/googletest-1.15.2/install | |
| make && make install | |
| - name: Checkout repo | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| fetch-depth: 0 | |
| - name: Install Lcov | |
| run: | | |
| sudo apt-get install lcov | |
| - name: Install dpctl dependencies | |
| shell: bash -l {0} | |
| run: | | |
| pip install numpy cython pytest pytest-cov scikit-build-core setuptools-scm cython-cmake cmake ninja coverage[toml] | |
| - name: Build dpctl with coverage | |
| shell: bash -l {0} | |
| env: | |
| SYCL_CACHE_PERSISTENT: 1 | |
| run: | | |
| source /opt/intel/oneapi/setvars.sh | |
| python scripts/gen_coverage.py --verbose | |
| - name: Install coverall dependencies | |
| shell: bash -l {0} | |
| run: | | |
| sudo gem install coveralls-lcov | |
| pip install coveralls | |
| - name: Upload coverage data to coveralls.io | |
| shell: bash -l {0} | |
| run: | | |
| echo "Processing c-api-coverage" | |
| DPCTL_LCOV_FN=$(find build/coverage -name dpctl.lcov) | |
| export DPCTL_LCOV_FN | |
| grep "/tmp" "$DPCTL_LCOV_FN" | |
| coveralls-lcov -v -n \ | |
| "$DPCTL_LCOV_FN" > dpctl-c-api-coverage.json | |
| echo "Processing pytest-coverage" | |
| DPCTL_PYTEST_LCOV=$(find . -name dpctl_pytest.lcov) | |
| export DPCTL_PYTEST_LCOV | |
| grep "/tmp" "$DPCTL_PYTEST_LCOV" | |
| coveralls-lcov -v -n \ | |
| "$DPCTL_PYTEST_LCOV" > pytest-dpctl-c-api-coverage.json | |
| echo "Merging JSON files" | |
| python -c "import json; \ | |
| fh1 = open('dpctl-c-api-coverage.json', 'r'); \ | |
| f1 = json.load(fh1); fh1.close(); \ | |
| fh2 = open('pytest-dpctl-c-api-coverage.json', 'r'); \ | |
| f2 = json.load(fh2); fh2.close(); \ | |
| f3 = {'source_files': f1['source_files'] + f2['source_files']}; \ | |
| fh3 = open('combined-dpctl-c-api-coverage.json', 'w'); \ | |
| json.dump(f3, fh3); fh3.close()" || exit 1 | |
| # merge combined file with coverage data and upload | |
| ls -lh dpctl-c-api-coverage.json pytest-dpctl-c-api-coverage.json \ | |
| combined-dpctl-c-api-coverage.json \ | |
| "$DPCTL_LCOV_FN" "$DPCTL_PYTEST_LCOV" | |
| echo "Merging combined files with coverage data" | |
| coveralls --service=github --merge=combined-dpctl-c-api-coverage.json | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| COVERALLS_PARALLEL: true | |
| SYCL_QUEUE_THREAD_POOL_SIZE: 6 | |
| coveralls: | |
| name: Indicate completion to coveralls.io | |
| needs: generate-coverage | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| container: python:3-slim | |
| steps: | |
| - name: Finished | |
| run: | | |
| pip3 install --upgrade coveralls | |
| coveralls --finish | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |