summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
diff options
context:
space:
mode:
authorBen Brown <ben@demerara.io>2022-02-05 16:12:56 +0000
committerBen Brown <ben@demerara.io>2022-02-05 16:20:40 +0000
commit6430f86d4c0d1834a47dfbb7d1c0cc3b9953728c (patch)
tree094b538554fbecd00ba31f0cbde91c38adf9641a /.gitlab-ci.yml
parent0ffd6856e172020e824ed61e7a6d00779c5999af (diff)
downloadlorry-6430f86d4c0d1834a47dfbb7d1c0cc3b9953728c.tar.gz
Update CI pipeline
Splits pipeline into two stages: linting and testing.
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r--.gitlab-ci.yml61
1 files changed, 28 insertions, 33 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3a23b4e..fd377a2 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -1,39 +1,34 @@
-image: debian:stretch
+stages:
+ - lint
+ - test
-before_script:
-- apt-get update -y
-- apt-get install -y -qq python3-dev python3-pip
-
-# Static checker
-- apt-get install -y pyflakes3
-
-# Deps for running tests
-- apt-get install -y -qq cmdtest
+lint:
+ stage: lint
+ image: python:3
+ before_script:
+ - pip install pre-commit
+ script:
+ - pre-commit run -a
-# Deps to run lorry tests
-- apt-get install -y -qq git bzr cvs mercurial subversion hg-fast-export git-svn git-cvs bzr-fastimport
-- pip3 install pyyaml
-- pip3 install https://gitlab.com/trovekube/cliapp/-/archive/cliapp-1.20180812.1/cliapp-cliapp-1.20180812.1.tar.gz
+test:
+ stage: test
+ image: debian:stretch
+ needs: []
+ before_script:
+ - apt-get update -y
+ - apt-get install -y -qq python3-dev python3-pip
-# Configure git and bzr to run tests
-- git config --global user.email "jdoe@example.com"
-- git config --global user.name "Lorry Baserocker"
-- bzr whoami "Lorry Baserocker <jdoe@example.com>"
+ # Deps for running tests
+ - apt-get install -y -qq cmdtest
-run-pyflakes:
- script:
- - |
- {
- find . -path ./.git -prune -o -name '*.py' -print
- find . -path ./.git -prune -o -type f -perm /111 -print |
- while read script; do
- # Check for Python shebang on the first line only
- if awk '/^#!.*python/ { exit 0 } { exit 1 }' "$script"; then
- echo "$script"
- fi
- done
- } | xargs pyflakes3
+ # Deps to run lorry tests
+ - apt-get install -y -qq git bzr cvs mercurial subversion hg-fast-export git-svn git-cvs bzr-fastimport
+ - pip3 install pyyaml
+ - pip3 install https://gitlab.com/trovekube/cliapp/-/archive/cliapp-1.20180812.1/cliapp-cliapp-1.20180812.1.tar.gz
-run-check:
+ # Configure git and bzr to run tests
+ - git config --global user.email "jdoe@example.com"
+ - git config --global user.name "Lorry Baserocker"
+ - bzr whoami "Lorry Baserocker <jdoe@example.com>"
script:
- - sh check
+ - ./check