-
Notifications
You must be signed in to change notification settings - Fork 20
107 lines (105 loc) · 3.79 KB
/
main.yaml
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
#
# (c) Copyright 2022 by Coinkite Inc. This file is covered by license found in COPYING-CC.
#
name: coinkite-tap-protocol
on:
push:
pull_request:
branches: [ $default-branch ]
workflow_dispatch:
jobs:
unix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- run: echo "triggered by a ${{ github.event_name }} event."
- run: echo "running on a ${{ runner.os }}"
- run: echo "branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install cktap dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt-get update -y
sudo apt-get install -y swig libpcsclite-dev tor
fi
if [ "$RUNNER_OS" == "macOS" ]; then
brew install tor swig
brew services start tor
fi
cd ${{ github.workspace }}
pip install -U pip wheel
pip install --editable '.[test,cli]' # cli for slot unsealing
- name: Install emulator dependencies and run emulated tapsigner
run: |
cd ${{ github.workspace }}
cd emulator
# separate emulator dependencies to virtual enviroment of its own
python3 -m venv venv
venv/bin/pip install -U pip wheel
venv/bin/pip install -r requirements.txt
venv/bin/pip install dataclasses # python36
venv/bin/python ecard.py --testnet emulate -t &
- name: Run lib unittests and tapsigner unittests
run: |
pytest -m "not satscard and not crypto" --cvc 123456 -vvv
- name: Kill tapsigner emulator process
run: |
pgrep -f ecard.py | xargs kill -9
- name: Run emulated satscard
run: |
cd ${{ github.workspace }}
cd emulator
venv/bin/python ecard.py --testnet emulate &
# unseal one slot
cktap unseal 123456
- name: Run satscard unittests
run: |
pytest -m "satscard" --cvc 123456 -vvv
- name: Run crypto comparison tests
run: |
pip install wallycore coincurve
pytest -m "crypto" -vvv
- run: echo "This job's status is ${{ job.status }}."
windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- run: echo "triggered by a ${{ github.event_name }} event."
- run: echo "running on a ${{ runner.os }}"
- run: echo "branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
# - name: Install tor
# run: |
# wget https://dist.torproject.org/torbrowser/11.5.1/tor-win64-0.4.7.8.zip -O tor-win64-0.4.7.8.zip
# 7z x tor-win64-0.4.7.8.zip
# cd Tor
# Start-Process "tor.exe" -WindowStyle Hidden
# shell: powershell
- name: Install cktap dependencies
run: |
pip install -U pip wheel
pip install --editable '.[test]'
shell: powershell
- name: Run non-device test
run: |
pytest -m "not device and not crypto" -k "not test_useragent" -vvv
- name: Run crypto comparison tests
run: |
pip install wallycore coincurve
pytest -m "crypto" -vvv
- run: echo "This job's status is ${{ job.status }}."