Skip to content

[FSTORE-1921] Improve documentation building process #994

[FSTORE-1921] Improve documentation building process

[FSTORE-1921] Improve documentation building process #994

Workflow file for this run

name: mkdocs-test
on: pull_request
jobs:
test-docs-build:
runs-on: ubuntu-latest
steps:
- name: Checkout main repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Checkout the API repo
uses: actions/checkout@v4
with:
# TODO: replace aversey with logicalclocks
repository: aversey/hopsworks-api
ref: ${{ github.base_ref }}
path: hopsworks-api
- name: Markdownlint
uses: DavidAnson/markdownlint-cli2-action@v21
with:
globs: '**/*.md'
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('java/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 8
uses: actions/setup-java@v5
with:
java-version: "8"
distribution: "adopt"
- name: Build javadoc documentation
working-directory: hopsworks-api/java
run: mvn clean install javadoc:javadoc javadoc:aggregate -DskipTests && cp -r target/site/apidocs ../../docs/javadoc
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
activate-environment: true
working-directory: hopsworks-api/python
- name: Install Python API dependencies
run: uv sync --extra dev --group docs --project hopsworks-api/python
- name: Install Python dependencies
run: uv pip install -r requirements-docs.txt
- name: Install Ubuntu dependencies
run: sudo apt update && sudo apt-get install -y libxml2-dev libxslt-dev
- name: Check for broken links
run: |
# run the server
mkdocs serve > /dev/null 2>&1 &
SERVER_PID=$!
echo "mk server in PID $SERVER_PID"
# Give enough time for deployment
sleep 30
echo "Launching linkchecker"
linkchecker --no-warnings --no-status http://127.0.0.1:8000/
# If ok just kill the server
kill -9 $SERVER_PID
- name: Setup git for mike
run: |
git config --global user.name Mike
git config --global user.email [email protected]
- name: Generate the docs with mike
run: mike deploy 3.2-SNAPSHOT dev -u