-
Notifications
You must be signed in to change notification settings - Fork 5
66 lines (64 loc) · 2.52 KB
/
websiteChecker.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
62
63
64
65
66
---
name: Simplifier IG Website Checking
#Uses the following python program https://github.com/linkchecker/linkchecker
on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
websiteurl:
default: "https://simplifier.net/guide/uk-core-implementation-guidance-directory?version=current"
jobs:
job1:
name: html error checker
runs-on: ubuntu-latest
steps:
- name: Checkout repo content
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r ./IGPageContentValidator/requirements.txt
- name: Execute HTML Error Check
run: INPUT_STORE=${{ github.event.inputs.websiteurl }} python ./IGPageContentValidator/errorChecker.py
job2:
name: url link checker
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt install python3-bs4 python3-dnspython python3-requests
pip3 install linkchecker
- name: Check input link is valid
run: >
echo 'exit codes can be found at
https://everything.curl.dev/usingcurl/returns'
curl ${{ github.event.inputs.websiteurl }} -s -f -o /dev/null
- name: Execute Link Check
run: >
linkchecker -r 2 --check-extern --no-status --ignore-url=[@] --ignore-url=r"^(?!.*http).*html.*$" -f
./IGPageContentValidator/linkcheckerrc ${{ github.event.inputs.websiteurl }} || test $? = 1;
job3:
name: spell checker
runs-on: ubuntu-latest
steps:
- name: checkout repo content
uses: actions/checkout@v4
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: 3.x
- name: Install dependencies
run: |
sudo apt install aspell
python -m pip install --upgrade pip
pip install -r ./IGPageContentValidator/requirements.txt
- name: execute relToAbsLinks.py
run: INPUT_STORE=${{ github.event.inputs.websiteurl }} python ./IGPageContentValidator/relToAbsLinks.py
- name: Execute Spell Check
run: cat OutputLinks.txt | while read p; do wget -nv -O - $p | aspell list -H --ignore 2 --camel-case --lang en_GB --add-html-skip=nocheck -p ./IGPageContentValidator/.aspell.en.pws |sort| uniq -c; echo -e '\n'; done;