summaryrefslogtreecommitdiff
path: root/.gitlab-ci.yml
blob: 3a23b4e17e6950433096d72d2d518123b527320c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
image: debian:stretch

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

# 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

# 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>"

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

run-check:
  script:
  - sh check