Set up Zuul check pipeline
Fixed: translateselectedtext:3
Change-Id: Ifcb104b3f4985240a89b3e59e919fa2e950ce497
diff --git a/.zuul.yaml b/.zuul.yaml
index 2a5dca9..c7094b7 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,4 +1,23 @@
+# == Zuul configuration file ==
+#
+# This file is used to configure this project and its associated jobs in Zuul.
+# Zuul is the CI/CD tool which lets us check changes before they are committed,
+# and build a canary version of the extension on a regular basis.
+#
+# More info about Zuul: https://zuul-ci.org/docs/zuul/
+
+- job:
+ name: translateselectedtext-lint
+ parent: web-ext-lint
+ pre-run: playbooks/lint/pre.yaml
+ run: playbooks/lint/run.yaml
+ irrelevant-files:
+ - ".github/.*"
+ - "docs/.*"
+ - "OWNERS"
+ - "README.md"
+
- project:
check:
jobs:
- - noop
+ - translateselectedtext-lint
diff --git a/Makefile b/Makefile
index 79fce51..b2c9d49 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-.PHONY: node_deps clean_dist deps clean_deps serve_chromium release release_chromium_stable release_chromium_beta clean_releases clean
+.PHONY: node_deps clean_dist deps clean_deps serve_chromium release release_chromium_stable release_chromium_beta build_test_extension clean_releases clean
.DEFAULT_GOAL := release
WEBPACK := ./node_modules/webpack-cli/bin/cli.js
@@ -32,6 +32,11 @@
$(RELEASE_SCRIPT) -c beta -b chromium -f
rm -rf dist/chromium
+# Target to build the extension for webext lint in the Zuul Check Pipeline.
+build_test_extension: deps
+ $(WEBPACK) --mode production --env browser_target=chromium
+ $(RELEASE_SCRIPT) -c stable -b chromium -f
+
clean_releases:
rm -rf out
diff --git a/playbooks/lint/pre.yaml b/playbooks/lint/pre.yaml
new file mode 100644
index 0000000..964416f
--- /dev/null
+++ b/playbooks/lint/pre.yaml
@@ -0,0 +1,3 @@
+- hosts: all
+ roles:
+ - role: ensure-genmanifest
diff --git a/playbooks/lint/run.yaml b/playbooks/lint/run.yaml
new file mode 100644
index 0000000..19b282e
--- /dev/null
+++ b/playbooks/lint/run.yaml
@@ -0,0 +1,6 @@
+- hosts: all
+ roles:
+ - role: build-extension
+ make_target: build_test_extension
+ - role: web-ext-lint
+ source_dir: "dist/chromium"
diff --git a/roles/build-extension/defaults/main.yaml b/roles/build-extension/defaults/main.yaml
new file mode 100644
index 0000000..2774de6
--- /dev/null
+++ b/roles/build-extension/defaults/main.yaml
@@ -0,0 +1 @@
+make_target: chromium_stable
diff --git a/roles/build-extension/tasks/main.yaml b/roles/build-extension/tasks/main.yaml
new file mode 100644
index 0000000..6ca0225
--- /dev/null
+++ b/roles/build-extension/tasks/main.yaml
@@ -0,0 +1,6 @@
+- name: Build extension
+ make:
+ chdir: "{{ zuul.project.src_dir }}"
+ target: "{{ make_target }}"
+ environment:
+ PATH: "{{ ansible_env.HOME }}/go/bin:/usr/local/go/bin:{{ ansible_env.PATH }}"