|
24 | 24 | INFRAHUB_IMAGE_VER: "local" |
25 | 25 | PYTEST_XDIST_WORKER_COUNT: 4 |
26 | 26 | INFRAHUB_TEST_IN_DOCKER: 1 |
27 | | - VALE_VERSION: "3.0.7" |
| 27 | + VALE_VERSION: "3.7.1" |
28 | 28 | GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }} |
29 | 29 | METRICS_ENDPOINT: ${{ secrets.METRICS_ENDPOINT }} |
30 | 30 |
|
|
36 | 36 | timeout-minutes: 5 |
37 | 37 | outputs: |
38 | 38 | documentation: ${{ steps.changes.outputs.documentation_all }} |
| 39 | + documentation_generated: ${{ steps.changes.outputs.documentation_generated_all }} |
39 | 40 | helm: ${{ steps.changes.outputs.helm_all }} |
40 | 41 | python: ${{ steps.changes.outputs.python_all }} |
41 | 42 | yaml: ${{ steps.changes.outputs.yaml_all }} |
@@ -115,6 +116,91 @@ jobs: |
115 | 116 | SHELLCHECK_OPTS: --exclude=SC2086 --exclude=SC2046 --exclude=SC2004 --exclude=SC2129 |
116 | 117 |
|
117 | 118 |
|
| 119 | + documentation: |
| 120 | + defaults: |
| 121 | + run: |
| 122 | + working-directory: ./docs |
| 123 | + if: | |
| 124 | + always() && !cancelled() && |
| 125 | + !contains(needs.*.result, 'failure') && |
| 126 | + !contains(needs.*.result, 'cancelled') && |
| 127 | + needs.files-changed.outputs.documentation == 'true' |
| 128 | + needs: ["files-changed", "yaml-lint", "python-lint"] |
| 129 | + runs-on: "ubuntu-22.04" |
| 130 | + timeout-minutes: 5 |
| 131 | + steps: |
| 132 | + - name: "Check out repository code" |
| 133 | + uses: "actions/checkout@v4" |
| 134 | + with: |
| 135 | + submodules: true |
| 136 | + - name: Install NodeJS |
| 137 | + uses: actions/setup-node@v4 |
| 138 | + with: |
| 139 | + node-version: 20 |
| 140 | + cache: 'npm' |
| 141 | + cache-dependency-path: docs/package-lock.json |
| 142 | + - name: "Install dependencies" |
| 143 | + run: npm install |
| 144 | + - name: "Setup Python environment" |
| 145 | + run: "pip install invoke toml" |
| 146 | + - name: "Build docs website" |
| 147 | + run: "invoke docs" |
| 148 | + |
| 149 | + validate-generated-documentation: |
| 150 | + if: | |
| 151 | + always() && !cancelled() && |
| 152 | + !contains(needs.*.result, 'failure') && |
| 153 | + !contains(needs.*.result, 'cancelled') && |
| 154 | + (needs.files-changed.outputs.python == 'true') || (needs.files-changed.outputs.documentation_generated == 'true') |
| 155 | + needs: ["files-changed", "yaml-lint", "python-lint"] |
| 156 | + runs-on: "ubuntu-22.04" |
| 157 | + timeout-minutes: 5 |
| 158 | + steps: |
| 159 | + - name: "Check out repository code" |
| 160 | + uses: "actions/checkout@v4" |
| 161 | + with: |
| 162 | + submodules: true |
| 163 | + - name: Set up Python |
| 164 | + uses: actions/setup-python@v5 |
| 165 | + with: |
| 166 | + python-version: "3.12" |
| 167 | + - name: "Setup Python environment" |
| 168 | + run: | |
| 169 | + pipx install poetry==1.8.5 |
| 170 | + poetry config virtualenvs.create true --local |
| 171 | + poetry env use 3.12 |
| 172 | + - name: "Install dependencies" |
| 173 | + run: "poetry install --no-interaction --no-ansi --extras ctl" |
| 174 | + - name: "Setup environment" |
| 175 | + run: "pip install invoke toml" |
| 176 | + - name: "Validate generated documentation" |
| 177 | + run: "poetry run invoke docs-validate" |
| 178 | + |
| 179 | + validate-documentation-style: |
| 180 | + if: | |
| 181 | + always() && !cancelled() && |
| 182 | + !contains(needs.*.result, 'failure') && |
| 183 | + !contains(needs.*.result, 'cancelled') |
| 184 | + needs: ["files-changed", "yaml-lint", "python-lint"] |
| 185 | + runs-on: "ubuntu-22.04" |
| 186 | + timeout-minutes: 5 |
| 187 | + steps: |
| 188 | + - name: "Check out repository code" |
| 189 | + uses: "actions/checkout@v4" |
| 190 | + with: |
| 191 | + submodules: true |
| 192 | + |
| 193 | + # The official GitHub Action for Vale doesn't work, installing manually instead: |
| 194 | + # https://github.com/errata-ai/vale-action/issues/103 |
| 195 | + - name: Download Vale |
| 196 | + run: | |
| 197 | + curl -sL "https://github.com/errata-ai/vale/releases/download/v${VALE_VERSION}/vale_${VALE_VERSION}_Linux_64-bit.tar.gz" -o vale.tar.gz |
| 198 | + tar -xzf vale.tar.gz |
| 199 | + env: |
| 200 | + VALE_VERSION: ${{ env.VALE_VERSION }} |
| 201 | + - name: "Validate documentation style" |
| 202 | + run: ./vale $(find ./docs -type f \( -name "*.mdx" -o -name "*.md" \) ) |
| 203 | + |
118 | 204 | unit-tests: |
119 | 205 | env: |
120 | 206 | # workaround for Rich table column width |
|
0 commit comments