From 85086e39ebcc7fe6aa999946fcf014cfc96a2a5b Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Thu, 23 Feb 2023 16:01:27 +0100 Subject: [PATCH] README.md: mention 'htmltest-action' for GitHub workflows --- .github/workflows/ci.yml | 36 +++++++++++----------- README.md | 24 ++++++++++++++- go.mod | 6 ++-- go.sum | 25 +++++++-------- htmltest/check-link_test.go | 2 +- htmltest/fixtures/generic/citeBlank.html | 2 +- htmltest/fixtures/generic/citeBroken.html | 2 +- htmltest/fixtures/generic/citeMissing.html | 2 +- htmltest/fixtures/generic/citeValid.html | 2 +- 9 files changed, 62 insertions(+), 39 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6b9fed..681e5ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,15 +9,15 @@ jobs: pre-commit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - - uses: pre-commit/action@v2.0.3 + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + - uses: pre-commit/action@v3.0.0 git-describe: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Fetch tags @@ -32,9 +32,9 @@ jobs: os: [ ubuntu-latest, macos-latest ] steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - name: Run unit tests @@ -49,13 +49,13 @@ jobs: os: [ ubuntu-latest, macos-latest ] steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Fetch tags run: git fetch --force --tags - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - name: Set binary name @@ -63,7 +63,7 @@ jobs: - name: Build run: go build -ldflags "-X main.date=`date -u +%Y-%m-%dT%H:%M:%SZ` -X main.version=`git describe --tags`" -o bin/$BINARY_NAME -x main.go - name: Upload binary - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: ${{ env.BINARY_NAME }} path: bin/${{ env.BINARY_NAME }} @@ -81,9 +81,9 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - name: gofmt @@ -95,17 +95,17 @@ jobs: needs: [ test, build ] steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Fetch tags run: git fetch --force --tags - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@v3 with: go-version: ${{ env.GO_VERSION }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v2 + uses: goreleaser/goreleaser-action@v4 with: version: latest args: release --rm-dist @@ -120,7 +120,7 @@ jobs: DOCKER_REPO: wjdp/htmltest steps: - name: Checkout repo - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: fetch-depth: 0 - name: Fetch tags @@ -128,11 +128,11 @@ jobs: - name: Set GIT_VERSION run: echo "GIT_VERSION=$(git describe --tags)" >> $GITHUB_ENV - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v2 - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v2 - name: Login to DockerHub - uses: docker/login-action@v1 + uses: docker/login-action@v2 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/README.md b/README.md index 35aa137..0e8c08b 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ This [godownloader](https://github.com/goreleaser/godownloader) script will quer curl https://htmltest.wjdp.uk | sudo bash -s -- -b /usr/local/bin ``` -You'll be prompted for your password. After simply do `htmltest` to run. +You'll be prompted for your password. Afterwards simply type `htmltest` to run. #### Into Current Directory @@ -55,6 +55,28 @@ Mount your directory with html files into the container and test them. If you need more arguments to the test run it like this: ```docker run -v $(pwd):/test --rm wjdp/htmltest -l 3 -s``` +### :octocat: GitHub Action + +You can make use of [`htmltest-action`](https://github.com/wjdp/htmltest-action) to run `htmltest` as part of your GitHub Actions workflow. + +1. Either by providing a path: + + ```yaml + - name: Run htmltest + uses: wjdp/htmltest-action@master + with: + path: dist + ``` + +2. Or by pointing a configuration file: + + ```yaml + - name: Run htmltest + uses: wjdp/htmltest-action@master + with: + config: .htmltest.yml + ``` + ### 🧾 Temporary Files We store temporary files in `tmp/.htmltest` by default. This contains a log of output and a cache of external links, speeding up subsequent runs. You probably want to ignore it in version control, and perhaps cache it in your CI system. diff --git a/go.mod b/go.mod index df4ab4b..e1f882e 100644 --- a/go.mod +++ b/go.mod @@ -1,18 +1,18 @@ module github.com/wjdp/htmltest require ( - github.com/badoux/checkmail v1.2.1 + github.com/badoux/checkmail v1.2.2-0.20210531140817-a155f10fefd5 github.com/daviddengcn/go-algs v0.0.0-20180330170136-fe23fabd9d06 // indirect github.com/daviddengcn/go-assert v0.0.0-20150305222929-ba7e68aeeff6 github.com/daviddengcn/go-villa v0.0.0-20200811194146-68107afb6d76 // indirect github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 - github.com/fatih/color v1.10.0 + github.com/fatih/color v1.14.1 github.com/golangplus/bytes v1.0.0 // indirect github.com/golangplus/sort v1.0.0 // indirect github.com/imdario/mergo v0.3.11 github.com/seborama/govcr v4.5.0+incompatible // indirect golang.org/x/net v0.0.0-20201224014010-6772e930b67b - golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 // indirect + golang.org/x/sys v0.5.0 // indirect gopkg.in/seborama/govcr.v4 v4.5.0 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index 1cc499b..dd22124 100644 --- a/go.sum +++ b/go.sum @@ -1,5 +1,5 @@ -github.com/badoux/checkmail v1.2.1 h1:TzwYx5pnsV6anJweMx2auXdekBwGr/yt1GgalIx9nBQ= -github.com/badoux/checkmail v1.2.1/go.mod h1:XroCOBU5zzZJcLvgwU15I+2xXyCdTWXyR9MGfRhBYy0= +github.com/badoux/checkmail v1.2.2-0.20210531140817-a155f10fefd5 h1:gSsYVF9m7yI1GiwXdDCOAAqkkFeSE49CZeUNlZCPE2A= +github.com/badoux/checkmail v1.2.2-0.20210531140817-a155f10fefd5/go.mod h1:XroCOBU5zzZJcLvgwU15I+2xXyCdTWXyR9MGfRhBYy0= github.com/daviddengcn/go-algs v0.0.0-20180330170136-fe23fabd9d06 h1:jEHTltplMBbYsHlSnvZD1J4CsfweUSJIqS8uP56q1Ng= github.com/daviddengcn/go-algs v0.0.0-20180330170136-fe23fabd9d06/go.mod h1:CpyLopUWBmqupyWU6OlSfrzgIuzNq0R6DXzM74O9RMs= github.com/daviddengcn/go-assert v0.0.0-20150305222929-ba7e68aeeff6 h1:OPIYL/VhQiSpoaxIcmeYdghLswBylfk6JDVCUqadXxg= @@ -8,8 +8,8 @@ github.com/daviddengcn/go-villa v0.0.0-20200811194146-68107afb6d76 h1:7m/Wr7m1KG github.com/daviddengcn/go-villa v0.0.0-20200811194146-68107afb6d76/go.mod h1:U8xNoHcXfPnZzy9zCxeKRjaJgC1d3613rFHjZVVAqKc= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= -github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= -github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.14.1 h1:qfhVLaG5s+nCROl1zJsZRxFeYrHLqWroPOQ8BWiNb4w= +github.com/fatih/color v1.14.1/go.mod h1:2oHN61fhTpgcxD3TSWCgKDiH1+x4OiDVVGH8WlgGZGg= github.com/golangplus/bytes v0.0.0-20160111154220-45c989fe5450/go.mod h1:Bk6SMAONeMXrxql8uvOKuAZSu8aM5RUGv+1C6IJaEho= github.com/golangplus/bytes v1.0.0 h1:YQKBijBVMsBxIiXT4IEhlKR2zHohjEqPole4umyDX+c= github.com/golangplus/bytes v1.0.0/go.mod h1:AdRaCFwmc/00ZzELMWb01soso6W1R/++O1XL80yAn+A= @@ -21,19 +21,20 @@ github.com/golangplus/testing v1.0.0 h1:+ZeeiKZENNOMkTTELoSySazi+XaEhVO0mb+eanrS github.com/golangplus/testing v1.0.0/go.mod h1:ZDreixUV3YzhoVraIDyOzHrr76p6NUh6k/pPg/Q3gYA= github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= +github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= +github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng= +github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/seborama/govcr v4.5.0+incompatible h1:XvdHtXi0d4cUAn+0aWolvwfS3nmhNC8Z+yMQwn/M64I= github.com/seborama/govcr v4.5.0+incompatible/go.mod h1:EgcISudCCYDLzbiAImJ8i7kk4+wTA44Kp+j4S0LhASI= golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78 h1:nVuTkr9L6Bq62qpUqKo/RnZCFfzDBL0bYo6w9OJUqZY= -golang.org/x/sys v0.0.0-20210113181707-4bcb84eeeb78/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= +golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/htmltest/check-link_test.go b/htmltest/check-link_test.go index 3322b02..eb3d94b 100644 --- a/htmltest/check-link_test.go +++ b/htmltest/check-link_test.go @@ -173,7 +173,7 @@ func TestAnchorExternalHrefIPTimeout(t *testing.T) { } func TestAnchorExternalBrokenOptionHrefIPTimeout(t *testing.T) { - // passes for broken IP address links when aksed + // passes for broken IP address links when asked hT := tTestFileOpts("fixtures/links/ip_timeout.html", map[string]interface{}{"IgnoreExternalBrokenLinks": true, "ExternalTimeout": 1}) tExpectIssueCount(t, hT, 0) diff --git a/htmltest/fixtures/generic/citeBlank.html b/htmltest/fixtures/generic/citeBlank.html index 75e628a..61a14bc 100644 --- a/htmltest/fixtures/generic/citeBlank.html +++ b/htmltest/fixtures/generic/citeBlank.html @@ -6,7 +6,7 @@

This text has been inserted

-

Everytime Kenny is killed, Stan will announce +

Every time Kenny is killed, Stan will announce Oh my God, you/they murdered Kenny! . diff --git a/htmltest/fixtures/generic/citeBroken.html b/htmltest/fixtures/generic/citeBroken.html index c251c20..4a278d0 100644 --- a/htmltest/fixtures/generic/citeBroken.html +++ b/htmltest/fixtures/generic/citeBroken.html @@ -6,7 +6,7 @@

This text has been inserted

-

Everytime Kenny is killed, Stan will announce +

Every time Kenny is killed, Stan will announce Oh my God, you/they murdered Kenny! . diff --git a/htmltest/fixtures/generic/citeMissing.html b/htmltest/fixtures/generic/citeMissing.html index f4372cd..2e65ed0 100644 --- a/htmltest/fixtures/generic/citeMissing.html +++ b/htmltest/fixtures/generic/citeMissing.html @@ -6,7 +6,7 @@

This text has been inserted

-

Everytime Kenny is killed, Stan will announce +

Every time Kenny is killed, Stan will announce Oh my God, you/they murdered Kenny! . diff --git a/htmltest/fixtures/generic/citeValid.html b/htmltest/fixtures/generic/citeValid.html index 38dd75e..bd5ff76 100644 --- a/htmltest/fixtures/generic/citeValid.html +++ b/htmltest/fixtures/generic/citeValid.html @@ -6,7 +6,7 @@

This text has been inserted

-

Everytime Kenny is killed, Stan will announce +

Every time Kenny is killed, Stan will announce Oh my God, you/they killed Kenny! .