|
| 1 | +name: Test Documentation Build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - '*' |
| 10 | + |
| 11 | +# Default to bash |
| 12 | +defaults: |
| 13 | + run: |
| 14 | + shell: bash |
| 15 | + |
| 16 | +jobs: |
| 17 | + |
| 18 | + dump-context: |
| 19 | + runs-on: ubuntu-latest |
| 20 | + steps: |
| 21 | + - name: Dump context "GitHub" |
| 22 | + env: |
| 23 | + GITHUB_CONTEXT: ${{ toJson(github) }} |
| 24 | + run: echo "$GITHUB_CONTEXT" |
| 25 | + |
| 26 | + test-build-documentation: |
| 27 | + runs-on: windows-latest |
| 28 | + steps: |
| 29 | + - name: Install Cairo via MSYS2 |
| 30 | + uses: msys2/setup-msys2@v2 |
| 31 | + with: |
| 32 | + update: true |
| 33 | + install: mingw-w64-x86_64-cairo |
| 34 | + - name: Add MSYS2 Cairo to PATH to make cairocffi libraries like libcairo-2.dll discoverable |
| 35 | + shell: powershell |
| 36 | + # "C:\msys64\mingw64\bin" did not work, try "C:\Program Files\Unity Hub\resources\app.asar.unpacked\node_modules\canvas\build\Release" |
| 37 | + # found using Get-ChildItem -Path C:\ -Filter "*libcairo*.d*" -File -Recurse -ErrorAction SilentlyContinue in Log step |
| 38 | + run: | |
| 39 | + echo "C:\Program Files\Unity Hub\resources\app.asar.unpacked\node_modules\canvas\build\Release" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append |
| 40 | + echo "CAIROCFFI_DLL_DIRECTORIES=C:\Program Files\Unity Hub\resources\app.asar.unpacked\node_modules\canvas\build\Release" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append |
| 41 | + - name: Log environment variable updates |
| 42 | + shell: powershell |
| 43 | + run: | |
| 44 | + Write-Host "GITHUB_PATH: $env:PATH" |
| 45 | + Write-Host "CAIROCFFI_DLL_DIRECTORIES: $env:CAIROCFFI_DLL_DIRECTORIES" |
| 46 | + - name: Check out the repository |
| 47 | + uses: actions/checkout@v5 |
| 48 | + - name: Set up Python |
| 49 | + uses: actions/setup-python@v6 |
| 50 | + with: |
| 51 | + python-version: '3.x' |
| 52 | + - name: Install dependencies |
| 53 | + run: | |
| 54 | + python -m pip install --upgrade pip |
| 55 | + pip install hatch pre-commit |
| 56 | + hatch env create docs |
| 57 | + - name: Build documentation |
| 58 | + run: hatch run docs:build-check |
0 commit comments