Skip to content
Merged
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
6 changes: 6 additions & 0 deletions .github/workflows/markdown-link-check-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this to be a drop in replacement, we need to only check changed files with check-modified-files-only option.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only wrote that functionality into the markdown checker because it was breaking on certain sites, and we knew the file it was breaking on wasn’t modified often. I think it’s safe to check all top-level files again.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also we need to check all links on each PR because a linked file could be moved, breaking links in unmodified docs.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, since we will be checking many fewer links, hopefully we won't get the 429s from github.

"ignorePatterns": [
{ "pattern": "^https://github.com/\\S+/\\S+/(issues|pull)/[0-9]+" },
{ "pattern": "^mailto:" }
]
}
17 changes: 17 additions & 0 deletions .github/workflows/markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Check Markdown links

on:
pull_request:
push:
branches:
- master

jobs:
markdown-link-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: gaurav-nelson/github-action-markdown-link-check@1.0.2
with:
max-depth: 1
config-file: '.github/workflows/markdown-link-check-config.json'
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,9 @@ jobs:
script:
- make test-sanity

# Run website and markdown doc checks
# Run website checks
- name: Doc Checks
script:
- make test-markdown
- make test-links

## Operator test stage jobs ##
Expand Down
7 changes: 2 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -209,13 +209,10 @@ image-push-scorecard-test:
##@ Tests

# Static tests.
.PHONY: test test-markdown test-sanity test-unit
.PHONY: test test-sanity test-unit

test: test-unit ## Run the tests

test-markdown:
./hack/check-markdown.sh

test-sanity: tidy build/operator-sdk lint
./hack/tests/sanity-check.sh

Expand All @@ -228,7 +225,7 @@ test-links:
# CI tests.
.PHONY: test-ci

test-ci: test-markdown test-sanity test-unit install test-subcommand test-e2e ## Run the CI test suite
test-ci: test-sanity test-unit install test-subcommand test-e2e ## Run the CI test suite

# Subcommand tests.
.PHONY: test-subcommand test-subcommand-local test-subcommand-scorecard test-subcommand-olm-install
Expand Down
26 changes: 0 additions & 26 deletions hack/check-markdown.sh

This file was deleted.

Binary file removed hack/ci/marker
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ $ export KUBECONFIG="$(kind get kubeconfig-path --name="kind")"
All the tests are run through the [`Makefile`][makefile]. This is a brief description of all makefile test instructions:

- `test` - Runs the unit tests (`test-unit`).
- `test-ci` - Runs markdown, sanity, and unit tests, installs the SDK binary, and runs the SDK subcommand and all E2E tests.
- `test-ci` - Runs sanity and unit tests, installs the SDK binary, and runs the SDK subcommand and all E2E tests.
- `test-sanity` - Runs sanity checks.
- `test-unit` - Runs unit tests.
- `test-subcommand` - Runs subcommand tests.
Expand All @@ -66,7 +66,6 @@ All the tests are run through the [`Makefile`][makefile]. This is a brief descri
- `test-e2e-ansible` - Runs the ansible E2E test.
- `test-e2e-ansible-molecule` - Runs the ansible molecule E2E test.
- `test-e2e-helm` - Runs the helm E2E test.
- `test-markdown` - Runs the markdown checks

For more info on what these tests actually do, please see the [Travis Build][travis] doc.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ In Travis CI, 4 jobs are run to test the sdk:
- [Go](#go-tests)
- [Ansible](#ansible-tests)
- [Helm](#helm-tests)
- [Markdown](#markdown)

### Before Install for Go, Ansible, and Helm

Expand Down Expand Up @@ -104,12 +103,6 @@ The Go, Ansible, and Helm tests then differ in what tests they run.

**NOTE**: All created resources, including the namespace, are deleted using a bash trap when the test finishes

### Markdown

The markdown test does not create a new cluster and runs in a barebones Travis VM configured only for `bash`. This allows documentation PRs to pass quickly, as they don't require code tests. The markdown checker uses a precompiled version of [`marker`][marker-github] stored in [`hack/ci/marker`][marker-local] to check the validity and correctness of the links in all markdown files in the `website/content/en/docs` directory.

**NOTE**: There is currently a bug in marker that causes link with underscores (`_`) to not be checked correctly.

[branches]: https://travis-ci.org/operator-framework/operator-sdk/branches
[pr-builds]: https://travis-ci.org/operator-framework/operator-sdk/pull_requests
[k8s-script]: https://github.com/operator-framework/operator-sdk/blob/master/hack/ci/setup-k8s.sh
Expand All @@ -122,6 +115,4 @@ The markdown test does not create a new cluster and runs in a barebones Travis V
[ansible-test]: https://github.com/operator-framework/operator-sdk/tree/master/test/ansible
[helm-e2e]: https://github.com/operator-framework/operator-sdk/blob/master/hack/tests/e2e-helm.sh
[helm-base]: https://github.com/operator-framework/operator-sdk/blob/master/hack/image/helm/scaffold-helm-image.go
[marker-github]: https://github.com/crawford/marker
[marker-local]: https://github.com/operator-framework/operator-sdk/blob/master/hack/ci/marker
[deps_mgmt]: ../../../golang/quickstart#a-note-on-dependency-management