summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorgeorg <georg@riseup.net>2018-03-15 02:24:22 +0100
committergeorg <georg@riseup.net>2018-03-15 02:34:48 +0100
commit9154884463333a04cf05be850cdb7cae82de4cc1 (patch)
tree66d9792c2282fe3f8e29d3740d988f655f067ddc /.gitlab-ci.yml
parent87ceef354f1e0d93d7261465d494bdc97230f0d1 (diff)
CI: Introduce codespell to check for spelling errors
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml36
1 files changed, 36 insertions, 0 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
new file mode 100644
index 0000000..3144ae6
--- /dev/null
+++ b/.gitlab-ci.yml
@@ -0,0 +1,36 @@
+---
+stages:
+ - static
+
+cache:
+ paths:
+ - vendor
+
+# Jobs that start with a period are disabled
+# This is just a template, to be used further below in the individual job definitions
+.setup_apt: &setup_apt
+ before_script:
+ # Export APT env vars to cache packages archives and lists based on the current working directory
+ - export APT_DIR=$CI_PROJECT_DIR/vendor/apt && export APT_ARCHIVES_DIR=$APT_DIR/archives && export APT_LISTS_DIR=$APT_DIR/lists
+ # Configure APT: Only install necessary packages, set cache location
+ - printf
+ "apt::install-recommends 0;\n
+ apt::install-suggests 0;\n
+ dir::cache::archives ${APT_ARCHIVES_DIR};\n
+ dir::state::lists ${APT_LISTS_DIR};\n"
+ >> /etc/apt/apt.conf.d/99custom
+ # Ensure the custom APT directory does exist
+ - mkdir -p {${APT_ARCHIVES_DIR},${APT_LISTS_DIR}}/partial
+ - apt-get update -qq
+ # To keep things DRY, use an env var to handle packages to be installed via APT
+ - apt-get install -qq -y $APT_INSTALL_PACKAGES
+
+codespell:
+ variables:
+ APT_INSTALL_PACKAGES: codespell
+ <<: *setup_apt
+ script:
+ # Run codespell to check for spelling errors, using a config to ignore
+ # warnings about binary files and to check file names as well.
+ - codespell -q 2 -f
+ stage: static