Fix broken links. #770
Workflow file for this run
This file contains 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: "Pull Request Docs Check" | |
on: | |
- pull_request | |
jobs: | |
build-pdf: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Refresh Packages | |
run: sudo apt-fast -y update | |
- name: Install Dependencies | |
run: xargs -a dependencies sudo apt-fast install -y | |
- name: Python Setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Python Install Dependencies | |
run: pip install -r docs/requirements.txt | |
- name: Build PDF | |
env: | |
SPHINXOPTS: "-D html_context.commit=${{ github.sha }} -D version=latest -A display_github=true -A github_user=${{ github.repository_owner }} -A github_repo=${{ github.event.repository.name }} -A github_version=${{ github.ref_name }} -A conf_py_path=/docs/source/" | |
run: make -C docs/ latexpdf | |
- name: Archive PDF | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
ID: ${{ github.run_attempt }} | |
uses: actions/upload-artifact@v4 | |
with: | |
name: FTCDOCS-PDF | |
path: | | |
docs/build/latex/*.pdf | |
FTCDOCS-PR-${{ env.PR_NUMBER }}-${{ env.ID }} | |
if-no-files-found: error | |
build-html: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Refresh Packages | |
run: sudo apt-fast -y update | |
- name: Python Setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Python Install Dependencies | |
run: pip install -r docs/requirements.txt | |
- name: Build Site | |
env: | |
SPHINXOPTS: "-W --keep-going -n -D html_context.commit=${{ github.sha }} -D version=latest -A display_github=true -A github_user=${{ github.repository_owner }} -A github_repo=${{ github.event.repository.name }} -A github_version=${{ github.ref_name }} -A conf_py_path=/docs/source/" | |
run: make -C docs/ html | |
- name: Archive Site | |
uses: actions/upload-artifact@v4 | |
with: | |
name: FTCDOCS-HTML | |
path: 'docs/build/html' | |
if-no-files-found: error | |
spelling-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- uses: reviewdog/action-misspell@v1 | |
with: | |
locale: "US" | |
reporter: "github-check" | |
link-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Python Setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Python Install Dependencies | |
run: pip install -r docs/requirements.txt | |
- name: Install additional dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y jq unzip | |
- name: Download previous artifact | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
curl -s -L \ | |
-H "Accept: application/vnd.github+json" \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
"https://api.github.com/repos/$GITHUB_REPOSITORY/actions/artifacts?per_page=100" > artifacts.json | |
DOWNLOAD_URL=$(jq -r '.artifacts[] | select(.name | startswith("LINKCHECK--")) | .archive_download_url' artifacts.json | head -n 1) | |
if [ -z "$DOWNLOAD_URL" ]; then | |
echo "No previous LINKCHECK artifact found" | |
exit 0 | |
fi | |
curl -L \ | |
-H "Authorization: Bearer $GITHUB_TOKEN" \ | |
-H "X-GitHub-Api-Version: 2022-11-28" \ | |
-o linkcheck.zip "$DOWNLOAD_URL" | |
if [ $? -ne 0 ]; then | |
echo "Failed to download the zip file" | |
exit 0 | |
fi | |
if unzip -t linkcheck.zip >/dev/null 2>&1; then | |
unzip -q linkcheck.zip -d linkcheck_contents | |
echo "Successfully downloaded and unzipped previous LINKCHECK artifact" | |
mv linkcheck_contents/output.json docs/main-output.json | |
else | |
echo "Downloaded file is not a valid zip. Skipping unzip." | |
rm linkcheck.zip | |
mkdir -p linkcheck_contents | |
fi | |
- name: link-check | |
run: | | |
make -C docs/ linkcheckdiff SPHINXOPTS="--keep-going" | |
- name: Archive Log | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: LINKCHECK-PR-${{ github.event.number }}-${{ github.run_attempt }} | |
path: docs/build/linkcheckdiff/output.json | |
retention-days: 7 | |
image-check: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Python Setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Python Install Dependencies | |
run: pip install -r docs/requirements.txt | |
- name: image-check | |
run: make -C docs/ imagecheck | |
check-redirect: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Fetch origin/main | |
run: git fetch origin main --depth=1 | |
- name: Python Setup | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
cache: 'pip' | |
- name: Python Install Dependencies | |
run: pip install -r docs/requirements.txt | |
- name: check-redirect | |
run: make -C docs/ rediraffecheckdiff |