-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
78 lines (71 loc) · 1.84 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
image: python:3.6
stages:
- test
- deploy
before_script:
- export PATH=$HOME/.local/bin:$PATH
- pip install --user twine
- pip install --user -e .[testing]
- python setup.py sdist
pytest3:
stage: test
image: python:3.6
script:
- python -m pytest airsspy/
buildcell_check:
# Test building with buildcell and run tests
stage: test
script:
# Install gfortran
- apt-get update
- apt-get install -y gfortran liblapack-dev libopenblas-dev curl
# Get and compile AIRSS 0.9.1
- curl -L -o AIRSS.tgz http://bit.ly/2KtvEWU
- tar zxf AIRSS.tgz
- cd airss-0.9.1 ; export FC=gfortran ; make all; make install
- export PATH=$(pwd)/bin:$PATH
- cd ../
# Install the package
- pip install --user -e .[testing]
- python -m pytest airsspy/tests/test_build.py
only:
- master
build_docker:
# Test building docker image using repo2docker
stage: test
image: docker:stable
services:
- docker:dind
before_script:
- echo '0. Installing dependencies...'
- apk add --no-cache pigz python3
- python3 -m venv venv
- . venv/bin/activate
- pip install jupyter-repo2docker
script:
- export VERSION=$(python3 -c "import repo2docker; print(repo2docker.__version__)")
- jupyter-repo2docker --debug --image-name "airsspy-repo2docker:test" --user-id 1000 --user-name bz1 --no-run .
- docker ps
- docker images
only:
- master
stage_production:
stage: deploy
variables:
TWINE_USERNAME: $STAGE_USERNAME
TWINE_PASSWORD: $STAGE_PASSWORD
script:
- twine check dist/*
- twine upload --repository-url $PACKAGR_REPOSITORY_URL dist/*
except:
- tags
deploy_production:
stage: deploy
variables:
TWINE_USERNAME: $PRODUCTION_USERNAME
TWINE_PASSWORD: $PRODUCTION_PASSWORD
script:
- twine check dist/*
- twine upload dist/*
only:
- tags