fix: ignore cache dictionary and be quicker to fail #19
This file contains hidden or 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: Generate Docs | |
| on: | |
| push: | |
| branches: ["main"] | |
| jobs: | |
| generate: | |
| runs-on: macos-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Checkout clore | |
| uses: actions/checkout@v6 | |
| - name: Setup pixi | |
| uses: prefix-dev/setup-pixi@v0.9.4 | |
| with: | |
| pixi-version: v0.67.0 | |
| activate-environment: true | |
| cache: true | |
| - name: Restore build cache | |
| id: restore-build-cache | |
| uses: actions/cache/restore@v4 | |
| with: | |
| path: build/Debug/ | |
| key: ${{ runner.os }}-debug-build-${{ hashFiles('pixi.lock', 'pixi.toml', '**/CMakeLists.txt', 'cmake/**/*.cmake') }} | |
| restore-keys: | | |
| ${{ runner.os }}-debug-build- | |
| - name: Configure | |
| run: pixi run cmake-config Debug | |
| - name: Build | |
| run: pixi run cmake-build Debug | |
| - name: Save build cache | |
| if: ${{ success() && steps.restore-build-cache.outputs.cache-hit != 'true' }} | |
| uses: actions/cache/save@v4 | |
| with: | |
| path: build/Debug/ | |
| key: ${{ steps.restore-build-cache.outputs.cache-primary-key }} | |
| - name: Generate documentation | |
| timeout-minutes: 10 | |
| env: | |
| OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }} | |
| OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
| run: | | |
| if [[ -z "${OPENAI_API_KEY}" || -z "${OPENAI_BASE_URL}" ]]; then | |
| echo "OPENAI_API_KEY and OPENAI_BASE_URL must be set to generate documentation." >&2 | |
| exit 1 | |
| fi | |
| ./build/Debug/bin/clore \ | |
| --compile-commands build/Debug/compile_commands.json \ | |
| --source-dir src \ | |
| --output-dir generated \ | |
| --log-level info \ | |
| --model deepseek-chat | |
| - name: Package documentation | |
| run: tar -czvf clore-docs.tar.gz generated | |
| - name: Upload documentation artifact | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: clore-docs | |
| path: clore-docs.tar.gz | |
| retention-days: 30 |