Skip to content

Merge pull request #2317 from GaijinEntertainment/string-lint-daslib #528

Merge pull request #2317 from GaijinEntertainment/string-lint-daslib

Merge pull request #2317 from GaijinEntertainment/string-lint-daslib #528

Workflow file for this run

name: Build doc
# Run only on tags and release publish
on:
release:
types: prereleased
push:
paths:
- 'doc/**'
- 'daslib/**'
- 'src/builtin/**'
pull_request:
paths:
- 'doc/**'
- 'daslib/**'
- 'src/builtin/**'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: "SCM Checkout"
uses: actions/checkout@v4
- name: "Install Python dependencies"
run: |
# Our bindings do not work on latest.
pip install -r doc/requirements.txt
- name: "Install CMake and Ninja"
uses: lukka/get-cmake@latest
- name: "Build: Daslang (for das2rst)"
run: |
set -eux
mkdir build
cmake --no-warn-unused-cli -B./build \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DDAS_HV_DISABLED=OFF \
-DDAS_PUGIXML_DISABLED=OFF \
-DDAS_LLVM_DISABLED=ON \
-DDAS_GLFW_DISABLED=ON \
-G Ninja
cmake --build ./build --target daslang
- name: "Run das2rst"
run: |
set -eux
./bin/daslang doc/reflections/das2rst.das
- name: "Check for // `stub` in handmade docs"
run: |
set -eux
if grep -rl '// stub' doc/source/stdlib/handmade/; then
echo "ERROR: Found // stub entries in handmade docs. Please provide proper documentation."
exit 1
fi
- name: "Check for new untracked RST files"
run: |
set -eux
UNTRACKED=$(git ls-files --others --exclude-standard doc/source/stdlib/)
if [ -n "$UNTRACKED" ]; then
echo "ERROR: das2rst generated new files not tracked in git:"
echo "$UNTRACKED"
echo "Run das2rst locally and commit the new files."
exit 1
fi
- name: "Build latex files"
run: |
sphinx-build -W --keep-going -b latex -d doc/sphinx-build doc/source build/latex
- name: "Build site"
run: |
# We do not upload site in release.
sphinx-build -W --keep-going -b html -d doc/sphinx-build doc/source build/site
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v4
with:
root_file: daslangstdlib.tex
working_directory: build/latex
continue_on_error: true
- name: Compile LaTeX document
uses: xu-cheng/latex-action@v4
with:
root_file: daslang.tex
working_directory: build/latex
continue_on_error: true
- name: Check pdf file
run: |
find . -name "*.pdf"
- name: "Create release"
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/latex/daslang.pdf
asset_name: daslang.pdf
asset_content_type: application/pdf
- name: "Create release"
if: github.event_name == 'release' && (github.event.action == 'published' || github.event.action == 'prereleased')
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: build/latex/daslangstdlib.pdf
asset_name: daslangstdlib.pdf
asset_content_type: application/pdf