Skip to content

Commit

Permalink
Merge branch 'ershi/github-check-generated-files' into 'main'
Browse files Browse the repository at this point in the history
Add GH workflow checks for generated files

See merge request omniverse/warp!744
  • Loading branch information
shi-eric committed Sep 23, 2024
2 parents c160d5a + 75170fa commit 4096d5e
Showing 1 changed file with 79 additions and 1 deletion.
80 changes: 79 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ jobs:

build-warp-ubuntu:
runs-on: ubuntu-latest
outputs:
artifact-url: ${{ steps.exports-header.outputs.artifact-url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -73,7 +75,13 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: build-artifact-ubuntu
path: ./warp/bin/
path: warp/bin/
- name: Upload exports.h
uses: actions/upload-artifact@v4
id: exports-header
with:
name: exports-header
path: warp/native/exports.h

build-warp-macos:
runs-on: macos-latest
Expand Down Expand Up @@ -221,3 +229,73 @@ jobs:
files: ./coverage.xml
flags: unittests
token: ${{ secrets.CODECOV_TOKEN }}

pull-request-docs:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
outputs:
artifact-url: ${{ steps.build-docs-output.outputs.artifact-url }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r docs/requirements.txt
- name: Build Sphinx documentation
run: python build_docs.py
- name: Upload artifacts
uses: actions/upload-artifact@v4
id: build-docs-output
with:
name: build-docs-output
path: |
warp/stubs.py
docs/modules/functions.rst
check-build-docs-output:
runs-on: ubuntu-latest
needs: pull-request-docs
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download build_docs.py output
uses: actions/download-artifact@v4
with:
name: build-docs-output
- name: Check functions.rst
env:
ARTIFACT_URL: ${{ needs.pull-request-docs.outputs.artifact-url }}
run: >
git diff --exit-code docs/modules/functions.rst ||
(echo "Please run build_docs.py (or download from $ARTIFACT_URL) and add docs/modules/functions.rst to your pull request." && false)
- name: Check stubs.py
env:
ARTIFACT_URL: ${{ needs.pull-request-docs.outputs.artifact-url }}
run: >
git diff --exit-code warp/stubs.py ||
(echo "Please run build_docs.py (or download from $ARTIFACT_URL) and add warp/stubs.py to your pull request." && false)
check-exports-header:
runs-on: ubuntu-latest
needs: build-warp-ubuntu
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download exports.h
uses: actions/download-artifact@v4
with:
name: exports-header
path: warp/native/
- name: Check exports.h
env:
ARTIFACT_URL: ${{ needs.build-warp-ubuntu.outputs.artifact-url }}
run: >
git diff --exit-code warp/native/exports.h ||
(echo "Please run build_lib.py (or download from $ARTIFACT_URL) and add warp/native/exports.h to your pull request." && false)

0 comments on commit 4096d5e

Please sign in to comment.