-
-
Notifications
You must be signed in to change notification settings - Fork 344
155 lines (129 loc) · 4.86 KB
/
documentation.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
---
name: Documentation
# Builds Markdown documentation for core and addons.
on:
push:
branches:
- main
- releasebranch_*
pull_request:
workflow_dispatch:
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
# renovate: datasource=python-version depName=python
PYTHON_VERSION: "3.12"
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: 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: Install Python dependencies
# We install both core and addon dependencies, but we don't install any
# dependencies from the extra list in addons because we don't actually
# run them (and they should be lazy-imported).
run: |
pip install -r grass/.github/workflows/python_requirements.txt
pip install -r grass-addons/.github/workflows/requirements.txt
- 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: Compile addons
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
- 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
run: |
mkdir "$MKDOCS_DIR/source/addons"
mv -v addons-build-dir/docs/md/source/* "$MKDOCS_DIR/source/addons"
- name: Rebuild keywords
run: |
export ARCH="$(grass --config arch)"
export ARCH_DISTDIR="$(grass --config path)"
export VERSION_NUMBER="$VERSION"
grass --tmp-project XY --exec \
python grass/man/build_keywords.py md "$MKDOCS_DIR/source" "$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 logs available
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: grass-addon-build-logs
if-no-files-found: error
path: addons-build-dir/logs
retention-days: 3
- name: Make the result available
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: mkdocs-site
if-no-files-found: error
path: ${{ env.MKDOCS_DIR }}/site
retention-days: 3