Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.md: mention 'htmltest-action' for GitHub workflows #208

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -49,21 +49,21 @@ 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
run: echo "BINARY_NAME=htmltest-${{ matrix.os }}-$(echo $GITHUB_REF | cut -d'/' -f 3)-$(echo $GITHUB_SHA | cut -c1-8)" >> $GITHUB_ENV
- 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 }}
Expand All @@ -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
Expand All @@ -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
Expand All @@ -120,19 +120,19 @@ jobs:
DOCKER_REPO: wjdp/htmltest
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: 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 }}
Expand Down
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
)
Expand Down
25 changes: 13 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
@@ -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=
Expand All @@ -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=
Expand All @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion htmltest/check-link_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion htmltest/fixtures/generic/citeBlank.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p><ins cite="">This text has been inserted</ins></p>

<p>Everytime Kenny is killed, Stan will announce
<p>Every time Kenny is killed, Stan will announce
<q cite="">
Oh my God, you/they murdered Kenny!
</q>.
Expand Down
2 changes: 1 addition & 1 deletion htmltest/fixtures/generic/citeBroken.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p><ins cite="nope.html">This text has been inserted</ins></p>

<p>Everytime Kenny is killed, Stan will announce
<p>Every time Kenny is killed, Stan will announce
<q cite="https://en.wikipedia.org/wiki/Kenny_McCormick_Nope">
Oh my God, you/they murdered Kenny!
</q>.
Expand Down
2 changes: 1 addition & 1 deletion htmltest/fixtures/generic/citeMissing.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p><ins>This text has been inserted</ins></p>

<p>Everytime Kenny is killed, Stan will announce
<p>Every time Kenny is killed, Stan will announce
<q>
Oh my God, you/they murdered Kenny!
</q>.
Expand Down
2 changes: 1 addition & 1 deletion htmltest/fixtures/generic/citeValid.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<p><ins cite="page.html">This text has been inserted</ins></p>

<p>Everytime Kenny is killed, Stan will announce
<p>Every time Kenny is killed, Stan will announce
<q cite="http://en.wikipedia.org/wiki/Kenny_McCormick#Cultural_impact">
Oh my God, you/they killed Kenny!
</q>.
Expand Down