Fixed scripting logic #2
Workflow file for this run
This file contains 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: Build mkl_random documentation | ||
on: | ||
pull_request: | ||
push: | ||
branches: [master] | ||
permissions: read-all | ||
jobs: | ||
build-and-deploy: | ||
name: Build and Deploy Documentation | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
steps: | ||
- name: Cancel Previous Runs | ||
uses: styfle/[email protected] | ||
with: | ||
access_token: ${{ github.token }} | ||
- name: Add Intel repository | ||
if: ${{ !github.event.pull_request || github.event.action != 'closed' }} | ||
run: | | ||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
rm GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | ||
sudo apt-get update | ||
- name: Install Intel OneAPI | ||
if: ${{ !github.event.pull_request || github.event.action != 'closed' }} | ||
run: | | ||
sudo apt-get install intel-oneapi-compiler-dpcpp-cpp intel-oneapi-mkl-devel | ||
- name: Setup Python | ||
if: ${{ !github.event.pull_request || github.event.action != 'closed' }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
architecture: x64 | ||
- name: Install sphinx dependencies | ||
if: ${{ !github.event.pull_request || github.event.action != 'closed' }} | ||
shell: bash -l {0} | ||
run: | | ||
pip install numpy cython setuptools scikit-build cmake sphinx sphinx_rtd_theme furo pydot graphviz sphinxcontrib-programoutput sphinxcontrib-googleanalytics sphinx_design | ||
- name: Checkout repo | ||
uses: actions/[email protected] | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
- name: Build mkl_random+docs | ||
if: ${{ !github.event.pull_request || github.event.action != 'closed' }} | ||
shell: bash -l {0} | ||
run: | | ||
# Ensure that SYCL libraries are on LD_LIBRARY_PATH | ||
source /opt/intel/oneapi/setvars.sh | ||
python setup.py develop | ||
python -c "import mkl_random; print(mkl_random.__version__)" || exit 1 | ||
sphinx-build -m html docs/source docs/build | ||
mkdir -p ~/rendered_docs | ||
cp -r docs/build/html/* ~/rendered_docs/ | ||
git clean -dfx | ||
- name: Save built docs as an artifact | ||
if: ${{ github.event.pull_request && github.event.action != 'closed'}} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ env.PACKAGE_NAME }} rendered documentation | ||
path: ~/rendered_docs |