|
1 | 1 | # https://docs.github.com/en/free-pro-team@latest/actions/guides/building-and-testing-python
|
2 | 2 |
|
3 |
| -name: Python |
4 |
| - |
5 |
| -on: [push] |
6 |
| - |
| 3 | +name: slow python |
| 4 | +on: |
| 5 | + pull_request: |
| 6 | + # These tests are so slow that we only run them when a PR is opened/reopened |
| 7 | + # If an existing PR gets new commits, only the libsec tests will run (to manually trigger a full test-suite, close and reopen the github PR) |
| 8 | + types: [opened, reopened] |
| 9 | + |
7 | 10 | jobs:
|
8 | 11 |
|
9 |
| - lint: |
10 |
| - runs-on: ${{ matrix.os }} |
11 |
| - strategy: |
12 |
| - matrix: |
13 |
| - python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] |
14 |
| - os: [ubuntu-20.04, macos-11, windows-2019] |
15 |
| - steps: |
16 |
| - - uses: actions/checkout@v2 |
17 |
| - - uses: actions/setup-python@v2 |
18 |
| - with: |
19 |
| - python-version: ${{ matrix.python-version }} |
20 |
| - - name: Install python testing dependencies |
21 |
| - run: | |
22 |
| - pip install -r requirements-test.txt |
23 |
| - - name: Lint with black |
24 |
| - run: | |
25 |
| - black . --diff --check |
26 |
| - - name: Lint with flake8 |
27 |
| - run: | |
28 |
| - # stop the build if there are Python syntax errors or undefined names |
29 |
| - flake8 . --count --statistics |
30 |
| -
|
31 |
| - cli-apps: |
32 |
| - runs-on: ${{ matrix.os }} |
33 |
| - strategy: |
34 |
| - matrix: |
35 |
| - python-version: [3.6, 3.7, 3.8, 3.9, "3.10"] |
36 |
| - # TODO CLI app testing doesn't work on windows due to different handling of pexcept: |
37 |
| - # https://github.com/pexpect/pexpect/issues/321 |
38 |
| - os: [ubuntu-20.04, macos-11] |
39 |
| - steps: |
40 |
| - - uses: actions/checkout@v2 |
41 |
| - - uses: actions/setup-python@v2 |
42 |
| - with: |
43 |
| - python-version: ${{ matrix.python-version }} |
44 |
| - - name: Install python testing dependencies |
45 |
| - run: | |
46 |
| - pip install -r requirements-test.txt |
47 |
| - - name: pytest CLI multisig |
48 |
| - run: | |
49 |
| - pytest -v test_multiwallet.py |
50 |
| - env: |
51 |
| - SKIP_GH_UNRELIABLE_TESTS: True |
52 |
| - - name: pytest CLI singlesig |
53 |
| - run: | |
54 |
| - pytest -v test_singlesweep.py |
55 |
| -
|
56 | 12 | unit-tests:
|
57 | 13 | runs-on: ${{ matrix.os }}
|
58 | 14 | strategy:
|
59 | 15 | matrix:
|
| 16 | + # TODO: consider cutting down on python-version/os combos for speed |
60 | 17 | python-version: [3.6, 3.7, 3.8, 3.9, "3.10"]
|
61 |
| - os: [ubuntu-20.04, macos-11, windows-2019] |
| 18 | + os: [ubuntu-20.04, macos-11, macos-12, windows-2019, windows-2022] |
| 19 | + # TODO: add ubuntu-22.04 support! Something is up with openssl for that |
| 20 | + # https://github.com/bitcoin-core/secp256k1/issues/542 |
| 21 | + exclude: |
| 22 | + # Ubuntu 22.04 doesn't come with python 3.6 installed |
| 23 | + - os: ubuntu-22.04 |
| 24 | + python-version: 3.6 |
62 | 25 | steps:
|
63 |
| - - uses: actions/checkout@v2 |
64 |
| - - uses: actions/setup-python@v2 |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + - uses: actions/setup-python@v4 |
65 | 28 | with:
|
66 | 29 | python-version: ${{ matrix.python-version }}
|
67 |
| - - name: Install python testing dependencies |
| 30 | + cache: 'pip' |
| 31 | + cache-dependency-path: '**/requirements-test.txt' |
| 32 | + - name: Install python dependencies |
68 | 33 | run: |
|
69 | 34 | pip install -r requirements-test.txt
|
70 |
| - - name: pytest unit tests |
| 35 | + - name: pytest unit tests in pure python |
71 | 36 | run: |
|
72 |
| - pytest -v buidl/test |
| 37 | + pytest -vv --durations=0 buidl/test |
| 38 | + |
| 39 | + |
0 commit comments