|
| 1 | +name: validate-docs |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + paths: |
| 6 | + # existing docs |
| 7 | + - "docs/**" |
| 8 | + # changes to the cli reference generator |
| 9 | + - "docsgen/**" |
| 10 | + # potential changes to commands documentation |
| 11 | + - "cli/**" |
| 12 | + # potential changes to gRPC documentation |
| 13 | + - "rpc/**" |
| 14 | + # changes to the workflow itself |
| 15 | + - ".github/workflows/validate-docs.yaml" |
| 16 | + push: |
| 17 | + # At this day, GitHub doesn't support YAML anchors, d'oh! |
| 18 | + paths: |
| 19 | + - "docs/**" |
| 20 | + - "docsgen/**" |
| 21 | + - "cli/**" |
| 22 | + - "rpc/**" |
| 23 | + - ".github/workflows/validate-docs.yaml" |
| 24 | + |
| 25 | +jobs: |
| 26 | + validate: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + |
| 29 | + steps: |
| 30 | + - name: Checkout |
| 31 | + uses: actions/checkout@v2 |
| 32 | + |
| 33 | + - name: Install Taskfile |
| 34 | + uses: Arduino/actions/setup-taskfile@master |
| 35 | + with: |
| 36 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 37 | + |
| 38 | + - name: Setup Go |
| 39 | + uses: actions/setup-go@v2-beta |
| 40 | + with: |
| 41 | + go-version: "1.14" |
| 42 | + |
| 43 | + - name: Install Go dependencies |
| 44 | + run: | |
| 45 | + go version |
| 46 | + go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc |
| 47 | +
|
| 48 | + - name: Install protoc compiler |
| 49 | + uses: arduino/setup-protoc@v1 |
| 50 | + with: |
| 51 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 52 | + |
| 53 | + - name: Setup Python |
| 54 | + uses: actions/setup-python@v1 |
| 55 | + with: |
| 56 | + python-version: "3.6" |
| 57 | + architecture: "x64" |
| 58 | + |
| 59 | + - name: Cache dependencies |
| 60 | + uses: actions/cache@v1 |
| 61 | + with: |
| 62 | + path: ~/.cache/pip |
| 63 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} |
| 64 | + restore-keys: | |
| 65 | + ${{ runner.os }}-pip- |
| 66 | +
|
| 67 | + - name: Install Python dependencies |
| 68 | + run: | |
| 69 | + python3 -m pip install --upgrade pip |
| 70 | + python3 -m pip install -r ./requirements_docs.txt |
| 71 | +
|
| 72 | + - name: Build docs website |
| 73 | + # Ensure the docs build is sane, these docs won't be published |
| 74 | + run: task docs:build |
0 commit comments