Skip to content

Commit b70ce14

Browse files
authored
Sync website validation assets with template (#108)
We have assembled a collection of reusable project assets: https://github.com/arduino/tooling-project-assets These assets will be used in the repositories of all Arduino tooling projects. Some minor improvements and standardizations have been made in the upstream "template" assets for checking the website publishing system, and those are introduced to this repository here. Notable: - Add paths filter to prevent unnecessary workflow runs - Bump Python version used by the workflow from 3.8 to 3.9 Some task names have changed: - `docs:build` -> `website:check` - `docs:serve` -> `website:serve`
1 parent 3222d17 commit b70ce14

File tree

3 files changed

+85
-52
lines changed

3 files changed

+85
-52
lines changed

Diff for: .github/workflows/check-mkdocs-task.yml

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
2+
name: Check Website
3+
4+
env:
5+
# See: https://github.com/actions/setup-go/tree/v2#readme
6+
GO_VERSION: "1.16"
7+
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
8+
PYTHON_VERSION: "3.9"
9+
10+
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
11+
on:
12+
push:
13+
paths:
14+
- ".github/workflows/check-mkdocs-task.ya?ml"
15+
- "Taskfile.ya?ml"
16+
- "go.mod"
17+
- "go.sum"
18+
- "mkdocs.ya?ml"
19+
- "poetry.lock"
20+
- "pyproject.toml"
21+
- "docs/**"
22+
- "docsgen/**"
23+
- "**.go"
24+
pull_request:
25+
paths:
26+
- ".github/workflows/check-mkdocs-task.ya?ml"
27+
- "Taskfile.ya?ml"
28+
- "go.mod"
29+
- "go.sum"
30+
- "mkdocs.ya?ml"
31+
- "poetry.lock"
32+
- "pyproject.toml"
33+
- "docs/**"
34+
- "docsgen/**"
35+
- "**.go"
36+
workflow_dispatch:
37+
repository_dispatch:
38+
39+
jobs:
40+
check:
41+
runs-on: ubuntu-latest
42+
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v2
46+
47+
- name: Install Go
48+
uses: actions/setup-go@v2
49+
with:
50+
go-version: ${{ env.GO_VERSION }}
51+
52+
- name: Install Python
53+
uses: actions/setup-python@v2
54+
with:
55+
python-version: ${{ env.PYTHON_VERSION }}
56+
57+
- name: Install Poetry
58+
run: pip install poetry
59+
60+
- name: Install Task
61+
uses: arduino/setup-task@v1
62+
with:
63+
repo-token: ${{ secrets.GITHUB_TOKEN }}
64+
version: 3.x
65+
66+
- name: Build website
67+
run: task website:check

Diff for: .github/workflows/validate-docs.yaml

-36
This file was deleted.

Diff for: Taskfile.yml

+18-16
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ tasks:
1010
cmds:
1111
- poetry install --no-root
1212

13-
docs:serve:
14-
desc: Run website locally
15-
deps:
16-
- task: poetry:install-deps
17-
- task: docs:generate
18-
cmds:
19-
- poetry run mkdocs serve
20-
2113
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/Taskfile.yml
2214
docs:generate:
2315
desc: Create all generated documentation content
@@ -37,14 +29,6 @@ tasks:
3729
cmds:
3830
- npx {{ .PRETTIER }} --write "**/*.md"
3931

40-
docs:build:
41-
desc: Build documentation website contents
42-
deps:
43-
- docs:generate
44-
- poetry:install-deps
45-
cmds:
46-
- poetry run mkdocs build -s
47-
4832
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml
4933
general:format-prettier:
5034
desc: Format all supported files with Prettier
@@ -228,6 +212,24 @@ tasks:
228212
cmds:
229213
- poetry run black .
230214

215+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-mkdocs-task/Taskfile.yml
216+
website:check:
217+
desc: Check whether the MkDocs-based website will build
218+
deps:
219+
- task: docs:generate
220+
- task: poetry:install-deps
221+
cmds:
222+
- poetry run mkdocs build --strict
223+
224+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-mkdocs-task/Taskfile.yml
225+
website:serve:
226+
desc: Run website locally
227+
deps:
228+
- task: docs:generate
229+
- task: poetry:install-deps
230+
cmds:
231+
- poetry run mkdocs serve
232+
231233
vars:
232234
PROJECT_NAME: "arduino-fwuploader"
233235
DIST_DIR: "dist"

0 commit comments

Comments
 (0)