Bug 1048650 - TaskCluster task for Sphinx documentation generation; r?dustin
I've wanted to have automated test coverage of Sphinx documentation
generation for years. Now that we can add new automation in-tree
using TaskCluster, this is easy to implement. So do it.
Probably the hackiest thing about this is the task reporting to the
"lint" platform. We don't really have a more appropriate place to put
this.
MozReview-Commit-ID: 52ruTjtsGVH
--- a/taskcluster/ci/legacy/tasks/branches/base_jobs.yml
+++ b/taskcluster/ci/legacy/tasks/branches/base_jobs.yml
@@ -305,16 +305,24 @@ tasks:
task: tasks/tests/mozlint-wpt.yml
root: true
when:
file_patterns:
- 'testing/web-platform/tests/**'
- 'python/mozlint/**'
- 'tools/lint/**'
- 'testing/docker/lint/**'
+ sphinx:
+ task: tasks/tests/sphinx.yml
+ root: true
+ when:
+ file_patterns:
+ - '**/*.py'
+ - '**/*.rst'
+ - 'tools/docs/**'
taskgraph-tests:
task: tasks/tests/taskgraph-tests.yml
root: true
when:
file_patterns:
- 'taskcluster/**/*.py'
- 'config/mozunit.py'
- 'python/mach/**/*.py'
new file mode 100644
--- /dev/null
+++ b/taskcluster/ci/legacy/tasks/tests/sphinx.yml
@@ -0,0 +1,53 @@
+---
+$inherits:
+ from: 'tasks/lint.yml'
+ variables:
+ build_product: 'lint'
+ build_name: 'sphinx'
+ build_type: 'opt'
+
+docker-image: lint
+task:
+ metadata:
+ name: '[TC] - Sphinx'
+ description: 'Sphinx in-tree docs'
+
+ payload:
+ image:
+ type: 'task-image'
+ path: 'public/image.tar'
+ taskId:
+ task-reference: '<docker-image>'
+
+ command:
+ - /home/worker/bin/run-task
+ - '--vcs-checkout=/home/worker/checkouts/gecko'
+ - '--'
+ - bash
+ - -cx
+ - >
+ cd /home/worker/checkouts/gecko &&
+ ./mach doc --outdir docs-out --no-open &&
+ rm -rf docs-out/html/Mozilla_Source_Tree_Docs/_venv &&
+ mv docs-out/html/Mozilla_Source_Tree_Docs docs &&
+ tar -czf docs.tar.gz docs
+
+ artifacts:
+ 'public/docs.tar.gz':
+ type: file
+ path: '/home/worker/checkouts/gecko/docs.tar.gz'
+ expires:
+ relative-datestamp: '1 year'
+
+ extra:
+ locations:
+ build: null
+ tests: null
+ treeherder:
+ machine:
+ platform: lint
+ groupSymbol: tc
+ symbol: 'Doc'
+ treeherderEnv:
+ - production
+ - staging