-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
40 lines (35 loc) · 1.36 KB
/
.gitlab-ci.yml
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
40
stages:
- format
- test
black_formatting:
image: python:3.6
stage: format
before_script:
# Perform an update to make sure the system is up to date.
- sudo apt-get update --fix-missing
# Download miniconda.
- wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; bash miniconda.sh -b -f -p $HOME/miniconda;
# Ensure the (mini) conda environment can be activated.
- export PATH="$HOME/miniconda/bin:$PATH"
# (Re)create the environment.yml file for the repository.
- conda env create -q -f environment.yml -n checkstyle-for-bash --force
# Activate the environment of the repository.
- source activate checkstyle-for-bash
script:
# Verify the Python code is black formatting compliant.
- black --version
- black . --diff --exclude '\.venv/|\.local/|\.cache/|\.git/'
- black . --line-length 79 --check --exclude '\.venv/|\.local/|\.cache/|\.git/'
# Verify the Python code is flake8 formatting compliant.
- flake8 . --max-line-length 81
allow_failure: false
test:pytest:36:
stage: test
image: python:3.6
script:
# Ensure the (mini) conda environment can be activated.
- export PATH="$HOME/miniconda/bin:$PATH"
# Activate the environment of the repository.
- source activate checkstyle-for-bash
# Run the python tests.
- python -m pytest