Skip to content

Commit

Permalink
docs: Add test-docs
Browse files Browse the repository at this point in the history
This change add support for testing documentation
using exec-docs

Signed-off-by: Qasim Sarfraz <qasimsarfraz@microsoft.com>
  • Loading branch information
mqasimsarfraz committed Oct 27, 2023
1 parent 9107ee0 commit 94ab354
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/kubectl-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,34 @@ jobs:
export AZURE_NODE_NAME=$(echo '${{ needs.create-aks-cluster.outputs.nodes }}' | jq -r ".[${{ strategy.job-index }}]")
make integration-test -o kubectl-aks
test-docs:
name: Test docs
runs-on: ubuntu-latest
needs: [ build, unit-tests ]
steps:
- uses: actions/checkout@v3
- name: Setup go
uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- name: Get kubectl-aks from artifact
uses: actions/download-artifact@v3
with:
name: kubectl-aks-ubuntu-latest-amd64-tar-gz
- name: Prepare kubectl-aks binary
shell: bash
run: |
tar zxvf kubectl-aks-ubuntu-latest-amd64.tar.gz
chmod +x kubectl-aks
mv kubectl-aks /usr/local/bin
ls -la
- name: Download ie
run: |
go install github.com/Azure/InnovationEngine/cmd/ie@03880d11fadcf98e39c465248aa1d5b64f99cdb7
- name: Test docs
run: make test-docs

release:
name: Release
needs: [ integration-tests ]
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*.exe~
*.dll
*.so
*.log
*.dylib
/kubectl-aks
/kubectl-aks-*-*
Expand Down
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ integration-test: kubectl-aks
AZURE_CLUSTER_NAME=$(AZURE_CLUSTER_NAME) \
go test -v ./test/integration/... -integration

# Test docs using Executable Documentation by Innovation Engine
.PHONY: test-docs
test-docs: install
ie --help > /dev/null || (echo "ie is not installed, please install it from https://github.com/Azure/InnovationEngine" && exit 1)
ie execute README.md

# Clean
.PHONY: clean
clean:
Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ It is possible to download the asset for a given release and platform from the
move the `kubectl-aks` executable to any folder in your `$PATH`.

```bash
VERSION=v0.2.0
VERSION=$(curl -s https://api.github.com/repos/azure/kubectl-aks/releases/latest | jq -r .tag_name)
curl -sL https://github.com/azure/kubectl-aks/releases/latest/download/kubectl-aks-linux-amd64-${VERSION}.tar.gz | sudo tar -C /usr/local/bin -xzf - kubectl-aks
kubectl aks version
```
Expand All @@ -77,7 +77,10 @@ kubectl aks version
## Usage

```bash
$ kubectl aks --help
kubectl aks --help
````
<!--expected_similarity=1.0-->
```
Azure Kubernetes Service (AKS) kubectl plugin

Usage:
Expand Down

0 comments on commit 94ab354

Please sign in to comment.