diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index bc095b834e..9fa84a4891 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,3 +14,14 @@ jobs: SHELL: /bin/bash - name: Exit 1 if not empty run: git diff --exit-code + markdown-link-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: gaurav-nelson/github-action-markdown-link-check@1.0.13 + with: + use-quiet-mode: 'yes' + use-verbose-mode: 'yes' + config-file: '.markdownlinkcheck.json' + folder-path: 'docs' + file-extension: '.md' diff --git a/.markdownlinkcheck.json b/.markdownlinkcheck.json new file mode 100644 index 0000000000..d7d05aba2b --- /dev/null +++ b/.markdownlinkcheck.json @@ -0,0 +1,18 @@ +{ + "ignorePatterns": [ + { + "pattern": "^https://github.com/[^/]+/[^/]+/(issues|labels|pull)" + }, + { + "pattern": "^http://169.254.42.42/[^/])" + }, + { + "pattern": "^https://api.scaleway.com/account/v1" + } + ], + "timeout": "20s", + "retryOn429": true, + "retryCount": 5, + "fallbackRetryDelay": "30s", + "aliveStatusCodes": [200, 206] +} \ No newline at end of file diff --git a/docs/developer.md b/docs/developer.md index 2fcba42bb6..ced8716698 100644 --- a/docs/developer.md +++ b/docs/developer.md @@ -31,14 +31,14 @@ Be sure to check out the resource you create in each test and remember to delete When running a test, you might need information such as ID that you cannot know in advance (such as ID of resources). The `core.Test` uses different helpers to pass useful information around. -One of them is the [`core.testMetadata`](https://github.com/scaleway/scaleway-cli/blob/v2/internal/core/testing.go#L80). +One of them is the [`core.testMetadata`](https://github.com/scaleway/scaleway-cli/blob/master/internal/core/testing.go#L80). It is designed to store information such as ID or object describing a resource during a test. This metadata can use the `render` method to provide helpful golang templating features to have commands arguments computed dynamically. #### BeforeFunc and AfterFunc Usually, you might need to set up and teardown resources when you are running a test for testing a specific command. -For that you can use [`BeforeFunc`](https://github.com/scaleway/scaleway-cli/blob/v2/internal/core/testing.go#L84) and [`AfterFunc`](https://github.com/scaleway/scaleway-cli/blob/v2/internal/core/testing.go#L86). +For that you can use [`BeforeFunc`](https://github.com/scaleway/scaleway-cli/blob/master/internal/core/testing.go#L100) and [`AfterFunc`](https://github.com/scaleway/scaleway-cli/blob/master/internal/core/testing.go#L102). Those types allow you to execute code before (`BeforeFunc`) or after (`AfterFunc`) the main command you want to test. Those functions can access the metadata to change dynamically their behavior. @@ -75,4 +75,4 @@ If you want to contribute new tests you should have the following: - Install go for your platform - Install your credentials, preferably in a configuration file (run `scw init`) - Keep in mind that if you record interaction, the resource you will instantiate will be delivered and billed. - - Clean up the resource you don't use once the recording is over. + - Clean up the resource you don't use once the recording is over. \ No newline at end of file