Skip to content

Releasenotes v10.2 and dietpi-config changes (#1188) #2874

Releasenotes v10.2 and dietpi-config changes (#1188)

Releasenotes v10.2 and dietpi-config changes (#1188) #2874

Workflow file for this run

name: Build test and quality checks
on:
pull_request:
push:
branches-ignore:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions: { contents: read }
jobs:
main:
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.owner.login != github.event.pull_request.base.repo.owner.login
runs-on: ubuntu-24.04
steps:
- name: Clone DietPi-Docs repository
id: clone
uses: actions/checkout@v6
- name: Setup Node.js for markdownlint-cli2
uses: actions/setup-node@v6
with:
node-version: '*'
check-latest: true
- name: Install markdownlint-cli2
run: sudo npm i -g markdownlint-cli2@latest
- name: Run markdownlint-cli2 to check Markdown files
run: markdownlint-cli2 '**.md'
- name: Install MkDocs and PySpelling
id: python
if: always() && steps.clone.outcome == 'success'
uses: actions/setup-python@v6
with:
# Match version on dietpi.com server
python-version: 3.13.12
pip-install: -Ur requirements.txt pyspelling
- name: Build DietPi-Docs
id: build
if: always() && steps.python.outcome == 'success'
run: mkdocs build -sd build/docs
- name: Install Aspell
id: aspell
if: always() && steps.build.outcome == 'success'
run: |
sudo apt-get -q update
sudo apt-get -qq --no-install-recommends install aspell-en
- name: Run PySpelling to check HTML files
if: always() && steps.aspell.outcome == 'success'
run: pyspelling -c .spellcheck.yml
- name: Download lychee
id: lychee
# Skip on push events into master
if: always() && steps.build.outcome == 'success' && ! endsWith(github.ref, '/master')
run: |
curl -sSfLo lychee.tar.gz "$(curl -sSfH 'Authorization: Bearer ${{ github.token }}' 'https://api.github.com/repos/lycheeverse/lychee/releases/latest' | mawk -F\" '/^ *"browser_download_url": ".*x86_64-unknown-linux-gnu\.tar\.gz"$/{print $4;exit}')"
tar xf lychee.tar.gz
- name: Restore lychee cache
uses: actions/cache/restore@v5
if: always() && steps.lychee.outcome == 'success'
with:
path: .lycheecache
key: lycheecache-${{ github.run_id }}
restore-keys: lycheecache-
- name: Run lychee to check README and HTML files
if: always() && steps.lychee.outcome == 'success'
# "429 Too Many Requests" on GitHub despite token
# Exclude URLs for newly added Markdown files as well as raw view and edit GitHub URLs for all existing Markdown files
# parallels.com|chromewebstore.google.com: Cloudflare lets client enter redirect loop, if it does not send a cookie, set in response.
# raspberrypi.com|www.reddit.com|superuser.com|x.com/DietPi_|www.patreon.com/DietPi: Network error: Forbidden
# www.wireguard.com: Regularly Timeout
# www.domoticz.com/forum.odroid.com/webtribunal.net/www.phpbb.com/www.npmjs.com: Protected by Cloudflare CAPTCHA
# github.com/MichaIng/: Even with GITHUB_TOKEN or a PAT, checks run into 403 and timeouts. Hence skip checks on own repositories, which we expect to remain valid.
# www.duckdns.org/: Regular "Network error: error sending request for url"
# https://planefinder.net/|https://go.nordvpn.net/aff_c?|(help|www).realvnc.com/: 403
# zdoom.org: Network error: error sending request for url
# sye.dk: Known to fail every other request with a network error
# unsplash.com: 401 when checked from GitHub runners
run: |
git fetch --depth=1 origin master
while read -r line; do exclude="$exclude|dietpi.com/${line%.md}/"; done < <(git diff --name-only --diff-filter=A origin/master docs | grep '\.md$')
while read -r line; do exclude="$exclude|github.com/MichaIng/DietPi-Docs/(raw|edit)/dev/$line"; done < <(find docs -type f -name '*.md')
./lychee -Enm 2 --require-https --include-fragments --index-files 'index.html' --cache --max-cache-age 2d --cache-exclude-status '201..' -a '200,429' --exclude '^(http://wiringpi.com/$|https://(github.com/MichaIng/|zdoom.org/|forum.zdoom.org/|planefinder.net/$|go.nordvpn.net/aff_c?|www.duckdns.org/$|www.wireguard.com/$|x.com/DietPi_$|www.patreon.com/DietPi$|www.linux-kvm.org/$|www.domoticz.com/|forum.odroid.com/|webtribunal.net/|www.phpbb.com/|www.npmjs.com/|www.spigotmc.org/|(help|www).realvnc.com/|help.roonlabs.com/|blynk.io/|play.google.com/store/apps/details|www.kickstarter.com|theunarchiver.com/$|www.parallels.com/|(www|forums).raspberrypi.com/|www.reddit.com/|superuser.com|chromewebstore.google.com|sye.dk/|unsplash.com/|'"$exclude"'))' --github-token '${{ github.token }}' --root-dir "$PWD/build" README.md 'build/**/*.html'
- name: Save lychee cache
uses: actions/cache/save@v5
if: always() && steps.lychee.outcome == 'success'
with:
path: .lycheecache
key: lycheecache-${{ github.run_id }}