From e97a8496c6b13f30d7714503645e64b4cc643df6 Mon Sep 17 00:00:00 2001 From: Naomi Pentrel <5212232+npentrel@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:00:37 +0100 Subject: [PATCH] Add github action to check links --- .github/workflows/linkcheck.yml | 42 ++++++++++++++++++++++++++++++ .htmltest.yml | 17 ++++++++++++ spatialmath/rotationMatrix.go | 2 +- spatialmath/rotationMatrix_test.go | 2 +- 4 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/linkcheck.yml create mode 100644 .htmltest.yml diff --git a/.github/workflows/linkcheck.yml b/.github/workflows/linkcheck.yml new file mode 100644 index 00000000000..abafc668c81 --- /dev/null +++ b/.github/workflows/linkcheck.yml @@ -0,0 +1,42 @@ +# .github/workflows/run-htmltest.yml +# (c) 2021 Robb Romans +# +# Run htmltest link checker on generated HTML output in dist/ +# https://github.com/wjdp/htmltest +# +name: run-htmltest +concurrency: + group: pullrequest-untrusted-htmltest-${{ github.event.number }} + cancel-in-progress: true +on: pull_request +jobs: + htmltest: + runs-on: ubuntu-large + container: + image: ghcr.io/cirruslabs/flutter:latest + steps: + - name: Checkout Code + uses: actions/checkout@v4 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: stable + cache: true + - name: Install doc2go + run: go install go.abhg.dev/doc2go@latest + - name: Generate API reference + run: doc2go -out www ./... + - name: Test HTML + # https://github.com/wjdp/htmltest-action/ + # Don't fail the build on broken links + continue-on-error: false + uses: wjdp/htmltest-action@master + with: + config: .htmltest.yml + - name: Archive htmltest results + uses: actions/upload-artifact@v3 + # Note: Set ACTIONS_RUNTIME_TOKEN env variable to test with nektos/act + with: + name: htmltest-report + path: tmp/.htmltest/htmltest.log + retention-days: 7 # Default is 90 days \ No newline at end of file diff --git a/.htmltest.yml b/.htmltest.yml new file mode 100644 index 00000000000..f2c6fd3f2b5 --- /dev/null +++ b/.htmltest.yml @@ -0,0 +1,17 @@ +DirectoryPath: "www" +EnforceHTTPS: true +IgnoreEmptyHref: true +IgnoreInternalEmptyHash: true +IgnoreDirectoryMissingTrailingSlash: false +IgnoreURLs: + - "app.viam.com" + - "fonts.gstatic.com" + - "contributor-covenant.org" +IgnoreDirs: + - "lib" +CacheExpires: "6h" +# IgnoreDirs: - if we need to ever ignore files +CheckInternal: false +CheckDoctype: false +CheckScripts: false +FileExtension: ".html" diff --git a/spatialmath/rotationMatrix.go b/spatialmath/rotationMatrix.go index 53453d9d6f6..1f936305008 100644 --- a/spatialmath/rotationMatrix.go +++ b/spatialmath/rotationMatrix.go @@ -38,7 +38,7 @@ func (rm *RotationMatrix) AxisAngles() *R4AA { } // Quaternion returns orientation in quaternion representation. -// reference: http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm +// reference: https://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/index.htm func (rm *RotationMatrix) Quaternion() quat.Number { var q quat.Number m := rm.mat diff --git a/spatialmath/rotationMatrix_test.go b/spatialmath/rotationMatrix_test.go index d8d7c2823c4..67e26c98121 100644 --- a/spatialmath/rotationMatrix_test.go +++ b/spatialmath/rotationMatrix_test.go @@ -11,7 +11,7 @@ import ( func TestQuaternionConversion(t *testing.T) { // Test that conversion to rotation matrix to quaternion is correct - // http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/examples/index.htm + // https://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/examples/index.htm cos45 := 0.7071067811865476 cases := []struct { input [9]float64