Repository navigation
Release week 8 #1627
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
| name: Build test and quality checks | |
| on: | |
| pull_request: | |
| push: | |
| branches-ignore: | |
| - master | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: {} | |
| 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 | |
| env: | |
| HEAD_OWNER: ${{ github.event.pull_request.head.repo.owner.login }} | |
| steps: | |
| - name: Deploy DietPi-Website locally | |
| id: deploy | |
| run: bash <(curl -sSf "https://raw.githubusercontent.com/${HEAD_OWNER:-$GITHUB_REPOSITORY_OWNER}/DietPi-Website/${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}/deploy.bash") . | |
| - name: Setup JRE for Nu Html Checker | |
| uses: actions/setup-java@v5 | |
| with: | |
| distribution: temurin | |
| # https://github.com/orgs/adoptium/repositories?q=temurin*-binaries | |
| java-version: 24 | |
| java-package: jre | |
| check-latest: true | |
| - name: Download Nu Html Checker | |
| run: curl -sSfLO 'https://github.com/validator/validator/releases/download/latest/vnu.jar' | |
| - name: Run Nu Html Checker to check HTML, CSS and SVG files | |
| run: find . -type f \( -name '*.html' -o -name '*.css' -o -name '*.svg' \) -exec java -jar vnu.jar --verbose --also-check-css --also-check-svg --filterpattern '.*skipping . heading level.*' {} + | |
| - name: Check for obsolete image files | |
| if: always() && steps.deploy.outcome == 'success' | |
| run: | | |
| ec=0 | |
| while read -r line; do [[ $line == 'images/dietpi-logo_'* ]] || grep -q "$line" *.html || { ec=1; echo "ERROR: $line is not used"; }; done < <(find images/ -type f) | |
| exit "$ec" | |
| - name: Setup Python for PySpelling | |
| id: python | |
| if: always() && steps.deploy.outcome == 'success' | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: 3.x | |
| check-latest: true | |
| - name: Install PySpelling | |
| id: pyspelling | |
| if: always() && steps.python.outcome == 'success' | |
| run: | | |
| { pip3 install -U pip setuptools wheel; pip3 install -U pyspelling; } & | |
| 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.pyspelling.outcome == 'success' | |
| run: pyspelling -vc .spellcheck.yml | |
| - name: Download lychee | |
| id: lychee | |
| if: always() && steps.deploy.outcome == 'success' | |
| 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 lychee | |
| - name: Run lychee to check Markdown and HTML files | |
| if: always() && steps.lychee.outcome == 'success' | |
| # x.com/DietPi_|www.patreon.com/DietPi: Network error: Forbidden | |
| # --include-fragments: https://github.com/lycheeverse/lychee/pull/1733 | |
| run: ./lychee -Enm 2 --require-https --cache --exclude '^https://(x.com/DietPi_|www.patreon.com/DietPi)$' --github-token '${{ github.token }}' --root-dir "$PWD" '**/*.md' '**/*.html' |