forked from spesmilo/electrum
-
Notifications
You must be signed in to change notification settings - Fork 24
/
.travis.yml
143 lines (143 loc) · 5.86 KB
/
.travis.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
dist: bionic
language: python
python:
- 3.6
- 3.7
- 3.8
git:
depth: false
before_install:
- git tag
install:
- sudo apt-get -y install libsecp256k1-0
- pip install -r contrib/requirements/requirements-travis.txt
cache:
- pip: true
- directories:
- /tmp/electrum-build
- /tmp/namecoin-core
script:
- tox
- ./contrib/check_nmc_rebranding
after_success:
- if [ "$TRAVIS_BRANCH" = "master" ]; then pip install requests && contrib/push_locale; fi
- coveralls
jobs:
include:
- name: "Regtest functional tests"
language: python
python: 3.7
install:
# TODO: switch back to apt-get after Namecoin Core has a PPA
#- sudo add-apt-repository -y ppa:luke-jr/bitcoincore
- sudo apt-get -qq update
#- sudo apt-get install -yq bitcoind
- (echo "1e7f06030881fac5b8a6d33f497f1cab9a120189741ec81bc21e58d5cd93fa6f /tmp/namecoin-core/namecoin.tar.gz" | sha256sum -c) || (rm -f /tmp/namecoin-core/* && curl -o /tmp/namecoin-core/namecoin.tar.gz https://www.namecoin.org/files/namecoin-core/namecoin-core-0.21.0.1/namecoin-nc0.21.0.1-x86_64-linux-gnu.tar.gz)
- cat /tmp/namecoin-core/namecoin.tar.gz | tar -xz
- sudo cp -a namecoin-nc0.21.0.1/* /usr/
- sudo apt-get -y install libsecp256k1-0
- pip install .[tests]
- pip install electrumx
# Install gojq for JSON parsing
- gimme 1.13
- source ~/.gimme/envs/go1.13.env
- GO111MODULE=on go get github.com/itchyny/gojq/cmd/gojq
- export PATH="${PATH}:$(go env GOPATH)/bin"
before_script:
- electrum_nmc/electrum/tests/regtest/start_bitcoind.sh
- electrum_nmc/electrum/tests/regtest/start_electrumx.sh
script:
- PYTHONPATH=$PYTHONPATH:$(pwd)/electrum_nmc python -m unittest electrum_nmc/electrum/tests/regtest.py
after_success: True
- name: "Flake8 linter tests"
language: python
install: pip install flake8
script: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- stage: binary builds
name: "Windows build"
language: c
python: false
env:
- TARGET_OS=Windows
services:
- docker
before_install: # we need a newer version of docker; 20.10+ seems to work
- sudo rm -rf /var/lib/apt/lists/*
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
- sudo apt-get update
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
- docker version
install:
- sudo docker build --no-cache -t electrum-nmc-wine-builder-img ./contrib/build-wine/
script:
- sudo docker run --name electrum-nmc-wine-builder-cont -v $PWD:/opt/wine64/drive_c/electrum-nmc --rm --workdir /opt/wine64/drive_c/electrum-nmc/contrib/build-wine electrum-nmc-wine-builder-img ./build.sh
after_success: true
- name: "Android build"
language: python
python: 3.7
services:
- docker
install:
- pip install requests && ./contrib/pull_locale
- ./contrib/make_packages
- sudo docker build --no-cache -t electrum-nmc-android-builder-img contrib/android
script:
- sudo chown -R 1000:1000 .
# Output something every minute or Travis kills the job
- while sleep 60; do echo "=====[ $SECONDS seconds still running ]====="; done &
- sudo docker run -it -u 1000:1000 --rm --name electrum-nmc-android-builder-cont --env CI=true -v $PWD:/home/user/wspace/electrum --workdir /home/user/wspace/electrum electrum-nmc-android-builder-img ./contrib/android/make_apk
# kill background sleep loop
- kill %1
- ls -la bin
- if [ $(ls bin | grep -c Electrum-*) -eq 0 ]; then exit 1; fi
after_success: true
# disabled for now as travis started to always time out:
- if: false AND ((branch = master) OR (tag IS present))
name: "MacOS build"
os: osx
language: c
env:
- TARGET_OS=macOS
python: false
install:
- git fetch --all --tags
script: ./contrib/osx/make_osx
after_script: ls -lah dist && md5 dist/*
after_success: true
- name: "AppImage build"
language: c
python: false
services:
- docker
install:
- sudo docker build --no-cache -t electrum-nmc-appimage-builder-img ./contrib/build-linux/appimage/
script:
- sudo docker run --name electrum-nmc-appimage-builder-cont -v $PWD:/opt/electrum-nmc --rm --workdir /opt/electrum-nmc/contrib/build-linux/appimage electrum-nmc-appimage-builder-img ./build.sh
after_success: true
- name: "tarball build"
language: c
python: false
services:
- docker
before_install:
# hack: travis already cloned the repo, but we re-clone now, as we need to have umask set BEFORE cloning
- umask 0022
- mkdir fresh_clone && cd fresh_clone
- git clone https://github.com/$TRAVIS_REPO_SLUG.git && cd electrum-nmc
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then git fetch origin pull/$TRAVIS_PULL_REQUEST/merge; fi
- git checkout $TRAVIS_COMMIT
- echo "Second git clone ready at $PWD"
install:
- sudo docker build --no-cache -t electrum-nmc-sdist-builder-img ./contrib/build-linux/sdist/
script:
- echo "Building sdist at $PWD"
- sudo docker run --name electrum-nmc-sdist-builder-cont -v $PWD:/opt/electrum-nmc --rm --workdir /opt/electrum-nmc/contrib/build-linux/sdist electrum-nmc-sdist-builder-img ./build.sh
after_success: true
- stage: release check
install:
- git fetch --all --tags
script:
- ./contrib/deterministic-build/check_submodules.sh
after_success: true
if: tag IS present