-
Notifications
You must be signed in to change notification settings - Fork 19
61 lines (61 loc) · 2.84 KB
/
main.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
name: Build test and quality checks
on: push
jobs:
Actions:
# https://github.com/actions/virtual-environments
runs-on: ubuntu-20.04
steps:
- name: Deploy DietPi-Website locally
id: deploy
run: bash -c "$(curl -sSfL https://raw.githubusercontent.com/MichaIng/DietPi-Website${GITHUB_REF#refs/heads}/deploy.bash)" bash .
- name: Setup JRE 16 for Nu Html Checker
# https://github.com/actions/setup-java/releases
uses: actions/setup-java@v2
with:
distribution: 'zulu'
# http://static.azul.com/zulu/bin/
java-version: '16'
java-package: jre
check-latest: true
- name: Download Nu Html Checker
run: |
curl -sSfL "$(curl -sSfL https://api.github.com/repos/validator/validator/releases/latest | mawk -F\" '/"browser_download_url.*vnu\.jar.*\.zip"/{print $4;exit}')" -o vnu.zip
unzip -jo vnu.zip dist/vnu.jar
rm vnu.zip
- 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 '.*(text-decoration-skip-ink|color-adjust|overflow-anchor|break-word|aspect-ratio|html).*' {} +
- name: Setup Python 3.9 for PySpelling
id: python
if: always() && steps.deploy.outcome == 'success'
# https://github.com/actions/setup-python/releases
uses: actions/setup-python@v2
with:
# https://github.com/actions/python-versions/releases
python-version: '3.9'
- 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: Setup Nginx for lychee
id: nginx
if: always() && steps.deploy.outcome == 'success'
run: |
sudo sed -i "/^[[:blank:]]*root[[:blank:]]/c\root $(pwd);" /etc/nginx/sites-available/default
sudo systemctl restart nginx
- name: Download lychee
id: lychee
if: always() && steps.nginx.outcome == 'success'
run: |
curl -sSfL "$(curl -sSfL https://api.github.com/repos/lycheeverse/lychee/releases/latest | mawk -F\" '/"browser_download_url.*x86_64-unknown-linux-gnu\.tar\.gz"/{print $4;exit}')" -o lychee.tar.gz
tar xf lychee.tar.gz
rm lychee.tar.gz
- name: Run lychee to check Markdown and HTML files
if: always() && steps.lychee.outcome == 'success'
run: ./lychee -X head -b 'http://127.0.0.1' --exclude 'chrome://gpu' --github-token '${{ secrets.GITHUB_TOKEN }}' '**/*.md' '**/*.html'