From 83b823400e109f89f318466c1e2423c9951b1a20 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Wed, 8 Nov 2023 09:35:16 -0800 Subject: [PATCH 1/3] Remove the Kernel's custom URL check to just use the CI-CD Actions one --- .github/actions/url_verifier.sh | 65 --------------------------------- .github/workflows/ci.yml | 11 ------ 2 files changed, 76 deletions(-) delete mode 100755 .github/actions/url_verifier.sh diff --git a/.github/actions/url_verifier.sh b/.github/actions/url_verifier.sh deleted file mode 100755 index e9804657b2..0000000000 --- a/.github/actions/url_verifier.sh +++ /dev/null @@ -1,65 +0,0 @@ -#!/bin/bash - - -PROJECT=$1 -echo "Verifying url links of: ${PROJECT}" -if [ ! -d "$PROJECT" ] -then - echo "Directory passed does not exist" - exit 2 -fi - -USER_AGENT="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.146 Safari/537.36" -SCRIPT_RET=0 - -set -o nounset # Treat unset variables as an error - -declare -A dict - -function test { - while IFS= read -r LINE; do - FILE=$(echo $LINE | cut -f 1 -d ':') - URL=$(echo $LINE | grep -IoE '\b(https?|ftp|file)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]*[-A-Za-z0-9+&@#/%=~_|]') - - # remove trailing / if it exists curl diferenciate between links with - # and without / at the end - # URL=`echo "$URL" | sed 's,/$,,'` - dict+=(["$URL"]="$FILE ") - done < <(grep -e 'https\?://' ${PROJECT} -RIa --exclude='*.exe' --exclude-dir=.git | tr '*' ' ') - - for UNIQ_URL in ${!dict[@]} # loop urls - do - CURL_RES=$(curl -si --user-agent "${USER_AGENT}" ${UNIQ_URL} 2>/dev/null| head -n 1 | cut -f 2 -d ' ') - RES=$? - - echo "=================================" - echo "Checking URL: ${UNIQ_URL}" - - if [ "${CURL_RES}" == '' -o "${CURL_RES}" != '200' ] - then - if [ "${CURL_RES}" == '' ] # curl returned an error - then - CURL_RES=$RES - SCRIPT_RET=1 - echo ERROR: Result is: "${CURL_RES}" - elif [ "${CURL_RES}" == '403' ] - then - SCRIPT_RET=1 - echo ERROR: Result is: "${CURL_RES}" - else - echo WARNING: Result is: "${CURL_RES}" - fi - else - echo SUCCESS: Result is: "${CURL_RES}" - fi - echo "=================================" - done - - if [ "${SCRIPT_RET}" -eq 0 ] - then - exit 0 - else - exit 1 - fi -} - -test diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46c6f7ee02..db2c70a341 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,17 +32,6 @@ jobs: - name: Link Verification uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@v2 - url-check: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - with: - path: ./kernel - - - name: URL Checker - run: | - bash kernel/.github/actions/url_verifier.sh kernel - verify-manifest: runs-on: ubuntu-latest steps: From 6c4849a73267ae04cbd3d21ca057a4bf6a960f19 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Wed, 8 Nov 2023 11:21:23 -0800 Subject: [PATCH 2/3] Allow skipping the check for https://misra.org.uk/misra-c since it now errors out every time due to captcha check --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db2c70a341..6129812b6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,7 +30,9 @@ jobs: - name: Clone This Repo uses: actions/checkout@v3 - name: Link Verification - uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@v2 + uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main + with: + exclude-urls: https://www.misra.org.uk/misra-c verify-manifest: runs-on: ubuntu-latest From 344407fc4b22a1085f4e26a13c32aaa138769402 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Wed, 8 Nov 2023 15:47:38 -0800 Subject: [PATCH 3/3] Don't need to exclude the misra URL, now handled in the CI-CD repo. Exclude portable directory from formatting check. --- .github/workflows/ci.yml | 4 ++-- .github/workflows/formatting.yml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6129812b6a..bc6d8802b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,8 @@ jobs: - uses: actions/checkout@v3 - name: Check Formatting of FreeRTOS-Kernel Files uses: FreeRTOS/CI-CD-Github-Actions/formatting@main + with: + exclude-dirs: portable spell-check: runs-on: ubuntu-latest @@ -31,8 +33,6 @@ jobs: uses: actions/checkout@v3 - name: Link Verification uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main - with: - exclude-urls: https://www.misra.org.uk/misra-c verify-manifest: runs-on: ubuntu-latest diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml index 04786bad51..14d41c9c0c 100644 --- a/.github/workflows/formatting.yml +++ b/.github/workflows/formatting.yml @@ -19,5 +19,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Apply Formatting Fix + id: check-formatting uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main - id: check-formatting + with: + exclude-dirs: portable