Skip to content

Sync website validation assets with template #108

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/check-mkdocs-task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/check-mkdocs-task.md
name: Check Website

env:
# See: https://github.com/actions/setup-go/tree/v2#readme
GO_VERSION: "1.16"
# See: https://github.com/actions/setup-python/tree/v2#available-versions-of-python
PYTHON_VERSION: "3.9"

# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
paths:
- ".github/workflows/check-mkdocs-task.ya?ml"
- "Taskfile.ya?ml"
- "go.mod"
- "go.sum"
- "mkdocs.ya?ml"
- "poetry.lock"
- "pyproject.toml"
- "docs/**"
- "docsgen/**"
- "**.go"
pull_request:
paths:
- ".github/workflows/check-mkdocs-task.ya?ml"
- "Taskfile.ya?ml"
- "go.mod"
- "go.sum"
- "mkdocs.ya?ml"
- "poetry.lock"
- "pyproject.toml"
- "docs/**"
- "docsgen/**"
- "**.go"
workflow_dispatch:
repository_dispatch:

jobs:
check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}

- name: Install Python
uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
run: pip install poetry

- name: Install Task
uses: arduino/setup-task@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
version: 3.x

- name: Build website
run: task website:check
36 changes: 0 additions & 36 deletions .github/workflows/validate-docs.yaml

This file was deleted.

34 changes: 18 additions & 16 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ tasks:
cmds:
- poetry install --no-root

docs:serve:
desc: Run website locally
deps:
- task: poetry:install-deps
- task: docs:generate
cmds:
- poetry run mkdocs serve

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/deploy-cobra-mkdocs-versioned-poetry/Taskfile.yml
docs:generate:
desc: Create all generated documentation content
Expand All @@ -37,14 +29,6 @@ tasks:
cmds:
- npx {{ .PRETTIER }} --write "**/*.md"

docs:build:
desc: Build documentation website contents
deps:
- docs:generate
- poetry:install-deps
cmds:
- poetry run mkdocs build -s

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-prettier-formatting-task/Taskfile.yml
general:format-prettier:
desc: Format all supported files with Prettier
Expand Down Expand Up @@ -228,6 +212,24 @@ tasks:
cmds:
- poetry run black .

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-mkdocs-task/Taskfile.yml
website:check:
desc: Check whether the MkDocs-based website will build
deps:
- task: docs:generate
- task: poetry:install-deps
cmds:
- poetry run mkdocs build --strict

# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/check-mkdocs-task/Taskfile.yml
website:serve:
desc: Run website locally
deps:
- task: docs:generate
- task: poetry:install-deps
cmds:
- poetry run mkdocs serve

vars:
PROJECT_NAME: "arduino-fwuploader"
DIST_DIR: "dist"
Expand Down