diff --git a/.github/workflows/errorChecker.yml b/.github/workflows/errorChecker.yml deleted file mode 100644 index a7658a7..0000000 --- a/.github/workflows/errorChecker.yml +++ /dev/null @@ -1,29 +0,0 @@ -# Action for the IGPageContentValidator to check any HTML errors within the IG webpages -name: run HTML Error Checker - -on: - push: - paths: - - IGPageContentValidator/** - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Checkout repo content - uses: actions/checkout@v3 - - - name: Set up python - uses: actions/setup-python@v4 - 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: python ./IGPageContentValidator/errorChecker.py - diff --git a/.github/workflows/linkchecker.yml b/.github/workflows/linkchecker.yml deleted file mode 100644 index 0ba1e95..0000000 --- a/.github/workflows/linkchecker.yml +++ /dev/null @@ -1,28 +0,0 @@ -# Action for the IGPageContentValidator to check any bad hyperlinks within the IG webpages -name: run Link Checker - -on: - push: - paths: - - IGPageContentValidator/** - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: checkout repo content - uses: actions/checkout@v3 - - - name: Install dependencies - run: | - sudo apt install python3-bs4 python3-dnspython python3-requests - pip3 install linkchecker - - name: Check input link is valid #Checks link is valid. Used as exit code 1 muted in 'execute linkchecker' - run: | - echo 'exit codes can be found at https://everything.curl.dev/usingcurl/returns' - curl $(head -n 1 ./IGPageContentValidator/website.txt) -s -f -o /dev/null - - - name: Execute Link Check # exit code 1 muted as linkchecker sets it if a link is not valid. This causes the GitHub action to fail. - run: | - linkchecker -r 2 --check-extern --no-status -f ./IGPageContentValidator/linkcheckerrc $(head -n 1 ./IGPageContentValidator/website.txt) || test $? = 1; diff --git a/.github/workflows/websiteChecker.yml b/.github/workflows/websiteChecker.yml index 11cef2d..11d9ad0 100644 --- a/.github/workflows/websiteChecker.yml +++ b/.github/workflows/websiteChecker.yml @@ -8,7 +8,7 @@ on: default: "https://simplifier.net/guide/uk-core-implementation-guidance-directory?version=current" jobs: job1: - name: html Error Checking + name: html error checker runs-on: ubuntu-latest steps: - name: Checkout repo content @@ -24,7 +24,7 @@ jobs: - name: Execute HTML Error Check run: INPUT_STORE=${{ github.event.inputs.websiteurl }} python ./IGPageContentValidator/errorChecker.py job2: - name: url link checking + name: url link checker runs-on: ubuntu-latest steps: - name: checkout repo content @@ -44,7 +44,7 @@ jobs: linkchecker -r 2 --check-extern --no-status -f ./IGPageContentValidator/linkcheckerrc ${{ github.event.inputs.websiteurl }} || test $? = 1; job3: - name: spell checking + name: spell checker runs-on: ubuntu-latest steps: - name: checkout repo content diff --git a/IGPageContentValidator/README.md b/IGPageContentValidator/README.md index 62303f2..cc7eb35 100644 --- a/IGPageContentValidator/README.md +++ b/IGPageContentValidator/README.md @@ -9,13 +9,13 @@ The website validation is in three parts: ## Instructions -1. Edit the file `website.txt` ensuring the website you want scraped is entered on the first line. Note: Only Simplifier.net guides will work with this checker. -2. Click the `Actions` button. the top 3 actions will be the individual checkers needed. Wait until there is a green tick next to each. -3. Within each Action click the `Build` button -4. Within the Build click the following for the results: -- HTML Error Check -- Link Check -- Spell Check +1. Go to [Actions..websiteChecker](https://github.com/NHSDigital/IOPS-FHIR-Test-Scripts/actions/workflows/websiteChecker.yml) +2. Click `Run workflow`. +3. Enter the website url into the `websiteurl` box and click `Run workflow`. +4. Click on the action and then click on the following for the results: +- html error checker +- link checker +- spell checker ## HTML Error Checking Uses the errorChecker.py script. Checks for any html errors on a website using BeautifulSoup's `find_all('div',{'class':"error"})`. This returns the errors for each individual page.