forked from cryptoadvance/specter-desktop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.cirrus.yml
120 lines (113 loc) · 4.92 KB
/
.cirrus.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
container:
# image: python:slim
# image: ubuntu:jammy
# image: python:3.10
image: registry.gitlab.com/cryptoadvance/specter-desktop/cirrus-jammy:20230206
# We assume here that we're having a proper python3 system including virtualenv and pip
prep_stuff_template: &PREP_STUFF_TEMPLATE
bitcoind_installation_cache:
folder: ./tests/bitcoin
fingerprint_script:
- cat pyproject.toml | grep "addopts = " | cut -d'=' -f2 | sed 's/--/+/g' | tr '+' '\n' | grep bitcoin | cut -d' ' -f2
- cat tests/bitcoin_gitrev_pinned 2> /dev/null || true
- cat /etc/os-release | grep VERSION
- cat ./tests/install_noded.sh
- echo "binary" # if the next line is --bitcoin binary, otherwise use echo "compile" - this ensures different caching keys.
populate_script: ./tests/install_noded.sh --debug --bitcoin binary
elementsd_installation_cache:
folder: ./tests/elements
fingerprint_script:
- cat pyproject.toml | grep "addopts = " | cut -d'=' -f2 | sed 's/--/+/g' | tr '+' '\n' | grep elements | cut -d' ' -f2
- cat tests/elements_gitrev_pinned 2> /dev/null || true
- cat /etc/os-release | grep VERSION
- cat ./tests/install_noded.sh
- echo "binary" # if the next line is --elements binary, otherwise use echo "compile" - this ensures different caching keys.
populate_script: ./tests/install_noded.sh --debug --elements binary
verify_script:
- echo " --> Version of python, virtualenv and pip3"
- python3 --version && virtualenv --version && pip3 --version
- echo " --> Executables in tests/elements/src"
- find tests/elements/src -maxdepth 1 -type f -executable -exec ls -ld {} \; || true
- echo " --> Executables in tests/elements/bin"
- find tests/elements/bin -maxdepth 1 -type f -executable -exec ls -ld {} \; || true
- echo " --> Executables in tests/bitcoin/src"
- find tests/bitcoin/src -maxdepth 1 -type f -executable -exec ls -ld {} \; || true
- echo " --> Executables in tests/bitcoin/bin"
- find tests/bitcoin/bin -maxdepth 1 -type f -executable -exec ls -ld {} \; || true
- echo " --> bitcoind version"
- tests/bitcoin/src/bitcoind -version | head -1 || true
- tests/bitcoin/bin/bitcoind -version | head -1 || true
- echo " --> elements version"
- tests/elements/src/elementsd -version | head -1 || true
- tests/elements/bin/elementsd -version | head -1 || true
pip_script:
#folder: /tmp/cirrus-ci-build/.env
#fingerprint_script: echo muh && cat requirements.txt
#populate_script:
- virtualenv --python=python .env
- source ./.env/bin/activate
- pip3 install -r requirements.txt --require-hashes && pip3 install -e ".[test]"
install_script:
- source ./.env/bin/activate
- pip3 install -e .
test_task:
<< : *PREP_STUFF_TEMPLATE
skip: "false"
test_script:
- source ./.env/bin/activate
- echo $PATH
# needed so that setuptools_scm has a t least one tag to guess the version properly
# and the tests/test_util_version.py doesn't fail
- git fetch origin refs/tags/v1.0.0
- pytest --cov=cryptoadvance --junitxml=./testresults.xml
always:
junit_artifacts:
path: "./testresults.xml"
format: junit
cypress_test_task:
skip: "false"
container:
image: registry.gitlab.com/cryptoadvance/specter-desktop/cypress-python-jammy:20230206
cpu: 6
memory: 6G
pre_prep_script:
# The stupid old debian-package is not installing a proper binary but just the python-package
- echo -e '#!/bin/bash\npython3 -m virtualenv "$@"' > /usr/local/bin/virtualenv
- chmod +x /usr/local/bin/virtualenv
- virtualenv --version
<< : *PREP_STUFF_TEMPLATE
npm_cache:
folder: ./node_modules
fingerprint_script: cat package-lock.json
populate_script: npm ci
cypress_script:
- source ./.env/bin/activate
#- pip3 install -e .
- ./utils/test-cypress.sh --debug run
junit_artifacts:
path: "cypresstest-output.xml"
type: text/xml
format: junit
always:
cypress_screenshots_artifacts:
path: "./cypress/screenshots/**"
cypress_videos_artifacts:
path: "./cypress/videos/**"
extension_smoketest_task:
<< : *PREP_STUFF_TEMPLATE
test_script:
- git config --global user.name "CI CD"
- git config --global user.email "[email protected]"
- source ./.env/bin/activate
- echo $PATH
- mkdir tmp && cd tmp
- mkdir testextension && cd testextension
- pwd
- python3 -m cryptoadvance.specter ext gen --ext-id cicdtest --org cryptoadvance --no-isolated-client --devicename cicddevice
- pip3 install -e .
- python3 -m cryptoadvance.specter server --config DevelopmentConfig --debug 2> specter.log &
- sleep 15
- cat specter.log | grep "Found CicdtestService" # Discovery failed
- cat specter.log | grep "Extension CicdtestService activated (alpha)"
- apt-get update && apt-get -y install curl
- curl http://127.0.0.1:25441/svc/cicdtest/ | grep "CicdtestService 4thewin."