Change CI to publish on GitHub pages #487
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
# SPDX-FileCopyrightText: 2024 The Khronos Group Inc. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Checks | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- run: pip install -r requirements.txt | |
- name: Checks | |
uses: pre-commit/action@v3.0.1 | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: docs | |
path: build | |
icpx: | |
runs-on: ubuntu-latest | |
env: | |
CXX: icpx | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: rscohn2/setup-oneapi@v0 | |
with: | |
components: | | |
icx@2023.2.1 | |
- name: Build Examples | |
run: | | |
source /opt/intel/oneapi/setvars.sh | |
cd source/examples | |
cmake -B build | |
make -j 2 -C build | |
ctest --test-dir build --label-exclude gpu | |
# Upload the HTML output from the build as a GitHub Pages artifact | |
# This does not publish the artifact to GitHub Pages, it just gets it ready. | |
upload-pages: | |
runs-on: ubuntu-latest | |
# Run only after checks are successful. | |
# Run only when commits are pushed to the main branch | |
# (not when a PR is opened). | |
needs: [checks, icpx] | |
if: ${{ github.event_name == 'push' }} | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: docs | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: html | |
# Publish the GitHub Pages artifact on GitHub Pages | |
publish-pages: | |
runs-on: ubuntu-latest | |
needs: upload-pages | |
# These permissions are required by "actions/deploy-pages". | |
permissions: | |
pages: write | |
id-token: write | |
# Do not allow two jobs to publish simultaneously. | |
concurrency: | |
group: "pages" | |
cancel-in-progress: false | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
steps: | |
- uses: actions/deploy-pages@v4 |