|
| 1 | +--- |
| 2 | +name: Simplifier IG Website Checking |
| 3 | +on: |
| 4 | + # Allows you to run this workflow manually from the Actions tab |
| 5 | + workflow_dispatch: |
| 6 | + inputs: |
| 7 | + websiteurl: |
| 8 | + default: "https://simplifier.net/guide/uk-core-implementation-guidance-directory?version=current" |
| 9 | +jobs: |
| 10 | + job1: |
| 11 | + name: html error checker |
| 12 | + runs-on: ubuntu-latest |
| 13 | + steps: |
| 14 | + - name: Checkout repo content |
| 15 | + uses: actions/checkout@v3 |
| 16 | + - name: Set up python |
| 17 | + uses: actions/setup-python@v4 |
| 18 | + with: |
| 19 | + python-version: 3.x |
| 20 | + - name: Install dependencies |
| 21 | + run: | |
| 22 | + python -m pip install --upgrade pip |
| 23 | + pip install -r ./IGPageContentValidator/requirements.txt |
| 24 | + - name: Execute HTML Error Check |
| 25 | + run: INPUT_STORE=${{ github.event.inputs.websiteurl }} python ./IGPageContentValidator/errorChecker.py |
| 26 | + job2: |
| 27 | + name: url link checker |
| 28 | + runs-on: ubuntu-latest |
| 29 | + steps: |
| 30 | + - name: checkout repo content |
| 31 | + uses: actions/checkout@v3 |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + sudo apt install python3-bs4 python3-dnspython python3-requests |
| 35 | + pip3 install linkchecker |
| 36 | + - name: Check input link is valid |
| 37 | + run: > |
| 38 | + echo 'exit codes can be found at |
| 39 | + https://everything.curl.dev/usingcurl/returns' |
| 40 | +
|
| 41 | + curl ${{ github.event.inputs.websiteurl }} -s -f -o /dev/null |
| 42 | + - name: Execute Link Check |
| 43 | + run: > |
| 44 | + linkchecker -r 2 --check-extern --no-status -f |
| 45 | + ./IGPageContentValidator/linkcheckerrc ${{ github.event.inputs.websiteurl }} || test $? = 1; |
| 46 | + job3: |
| 47 | + name: spell checker |
| 48 | + runs-on: ubuntu-latest |
| 49 | + steps: |
| 50 | + - name: checkout repo content |
| 51 | + uses: actions/checkout@v3 |
| 52 | + - name: Set up python |
| 53 | + uses: actions/setup-python@v4 |
| 54 | + with: |
| 55 | + python-version: 3.x |
| 56 | + - name: Install dependencies |
| 57 | + run: | |
| 58 | + sudo apt install aspell |
| 59 | + python -m pip install --upgrade pip |
| 60 | + pip install -r ./IGPageContentValidator/requirements.txt |
| 61 | + - name: execute relToAbsLinks.py |
| 62 | + run: INPUT_STORE=${{ github.event.inputs.websiteurl }} python ./IGPageContentValidator/relToAbsLinks.py |
| 63 | + |
| 64 | + - name: Execute Spell Check |
| 65 | + run: cat OutputLinks.txt | while read p; do wget -nv -O - $p | aspell list -H --camel-case --lang en_GB --add-html-skip=nocheck -p ./IGPageContentValidator/.aspell.en.pws |sort| uniq -c; echo -e '\n'; done; |
0 commit comments