-
-
Notifications
You must be signed in to change notification settings - Fork 370
CI: Add workflow to build mkdocs in GHA #5152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 7 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
6bc3fe9
CI: Add workflow to build mkdocs in GHA
wenzeslaus 97b638a
Fix paths to aux scripts
wenzeslaus 7ef7e94
Fix vars, dir, name
wenzeslaus 4bf32ad
Get the right repo, fix artifact name
wenzeslaus f03a23c
Get addons according to the version (breaks for major version transit…
wenzeslaus 48bb113
ARCH needs to be defined (any value should do), make addon build logs…
wenzeslaus 3aff270
Use if-no-files-found, renovate, fix mv typo
wenzeslaus 15c4681
Correct place for if-no-files-found: warn
wenzeslaus 32a6ae7
Remove copy-pased trailing whitespace
wenzeslaus b68bda9
Add workflow trigger, get the logs before the docs, fails if no docs
wenzeslaus 2556b10
Merge branch 'main' into build-mkdocs-in-ci
echoix File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| --- | ||
| name: Documentation | ||
|
|
||
| # Builds Markdown documentation for core and addons. | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| - releasebranch_* | ||
| pull_request: | ||
|
|
||
| permissions: {} | ||
|
|
||
| jobs: | ||
| ubuntu: | ||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| runs-on: ubuntu-22.04 | ||
| env: | ||
| PYTHONWARNINGS: always | ||
wenzeslaus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| # renovate: datasource=python-version depName=python | ||
| PYTHON_VERSION: "3.12" | ||
wenzeslaus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| steps: | ||
| - name: Checkout core | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| repository: OSGeo/grass | ||
| path: grass | ||
|
|
||
| - name: Get dependencies | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get install -y wget git gawk findutils | ||
| xargs -a <(awk '! /^ *(#|$)/' "grass/.github/workflows/apt.txt") -r -- \ | ||
| sudo apt-get install -y --no-install-recommends --no-install-suggests | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0 | ||
| with: | ||
| python-version: ${{ env.PYTHON_VERSION }} | ||
| cache: pip | ||
|
|
||
| - name: Create installation directory | ||
| run: | | ||
| mkdir "$HOME/install" | ||
|
|
||
| - name: Set number of cores for compilation | ||
| run: | | ||
| echo "MAKEFLAGS=-j$(nproc)" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Set LD_LIBRARY_PATH for compilation | ||
| run: | | ||
| echo "LD_LIBRARY_PATH=$HOME/install/lib" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Build core | ||
| run: | | ||
| cd grass | ||
| ../grass/.github/workflows/build_ubuntu-22.04.sh "$HOME/install" | ||
|
|
||
| - name: Add the bin directory to PATH | ||
| run: | | ||
| echo "$HOME/install/bin" >> "$GITHUB_PATH" | ||
|
|
||
| - name: Print installed versions | ||
| if: always() | ||
| run: ./grass/.github/workflows/print_versions.sh | ||
|
|
||
| - name: Test executing of the grass command | ||
| run: ./grass/.github/workflows/test_simple.sh | ||
|
|
||
| - name: Set version variables | ||
| run: | | ||
| cd grass | ||
| eval $(./utils/update_version.py status --bash) | ||
| echo "MAJOR=$MAJOR" >> $GITHUB_ENV | ||
| echo "MINOR=$MINOR" >> $GITHUB_ENV | ||
| echo "VERSION=$VERSION" >> $GITHUB_ENV | ||
| echo "YEAR=$YEAR" >> $GITHUB_ENV | ||
|
|
||
| - name: Checkout addons | ||
| uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | ||
| with: | ||
| repository: OSGeo/grass-addons | ||
| ref: grass${{ env.MAJOR }} | ||
| path: grass-addons | ||
|
|
||
| - name: Compile addons | ||
| continue-on-error: true | ||
| run: | | ||
| ./grass-addons/utils/cronjobs_osgeo_lxd/compile_addons_git.sh \ | ||
| "$MAJOR" \ | ||
| "$MINOR" \ | ||
| $(pwd)/grass-addons/src \ | ||
| $(grass --config path) \ | ||
| $(pwd)/addons-build-dir \ | ||
| grass | ||
wenzeslaus marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - name: Get target path for Markdown files | ||
| run: | | ||
| echo MKDOCS_DIR="$(grass --config path)/docs/mkdocs" >> "$GITHUB_ENV" | ||
|
|
||
| - name: Move from build to target directory | ||
| continue-on-error: true | ||
| run: | | ||
| mkdir -p "$MKDOCS_DIR/source/addons" | ||
| mv addons-build-dir/docs/md/source/* "$MKDOCS_DIR/source/addons" | ||
|
|
||
| - name: Rebuild keywords | ||
| continue-on-error: true | ||
| run: | | ||
| export ARCH="linux" | ||
| export ARCH_DISTDIR="$(grass --config path)" | ||
| export TOP_DOCS_DIR="${ARCH_DISTDIR}/docs" | ||
| export VERSION_NUMBER="$VERSION" | ||
| grass --tmp-project XY --exec python grass/man/build_keywords.py "$TOP_DOCS_DIR" "$MKDOCS_DIR/source/addons" | ||
|
|
||
| - name: Get mkdocs | ||
| run: | | ||
| pip install -r "grass/man/mkdocs/requirements.txt" | ||
|
|
||
| - name: Run mkdocs | ||
| run: | | ||
| cd grass | ||
| eval $(./utils/update_version.py status --bash) | ||
| cd .. | ||
| export SITE_NAME="GRASS GIS $VERSION Reference Manual" | ||
| export COPYRIGHT="© 2003-$YEAR GRASS Development Team, GRASS GIS $VERSION Reference Manual" | ||
| cd $MKDOCS_DIR | ||
| mkdocs build | ||
|
|
||
| - name: Make the result available | ||
| uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | ||
| with: | ||
| name: mkdocs-site | ||
wenzeslaus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if-no-files-found: warn | ||
| path: ${{ env.MKDOCS_DIR }}/site | ||
| retention-days: 3 | ||
|
|
||
| - name: Make logs available | ||
| uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0 | ||
| if-no-files-found: warn | ||
| with: | ||
| name: grass-addon-build-logs | ||
wenzeslaus marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| path: addons-build-dir/docs/logs | ||
| retention-days: 3 | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.