-
Notifications
You must be signed in to change notification settings - Fork 769
139 lines (114 loc) · 4.45 KB
/
main.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
name: main
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
check:
env:
WEB3_INFURA_PROJECT_ID: "1c91697c211f4fcd8c7361f4c4e1f55f"
# not sure why, but this doesn't work currently:
# WEB3_INFURA_PROJECT_ID: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
# WEB3_INFURA_API_SECRET: ${{ secrets.WEB3_INFURA_API_SECRET }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install libenchant-2-dev libbz2-dev libsnappy-dev libunwind-dev libgirepository1.0-dev
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Python package dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Flake8
run: tox -c tox.ini -e flake8
test:
env:
CB_FULLTESTS: 1
WEB3_INFURA_PROJECT_ID: "1c91697c211f4fcd8c7361f4c4e1f55f"
# not sure why, but this doesn't work currently:
# WEB3_INFURA_PROJECT_ID: ${{ secrets.WEB3_INFURA_PROJECT_ID }}
# WEB3_INFURA_API_SECRET: ${{ secrets.WEB3_INFURA_API_SECRET }}
# Test on Ubuntu, MacOS, Windows using CPython and PyPy
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-22.04]
# os: [ubuntu-22.04, macos-latest, windows-latest]
# python 3.11 fails with "src/twisted/test/raiser.c:198:12: fatal error: longintrepr.h: No such file or directory"
# twisted doesn't yet support 3.11 formally: https://github.com/twisted/twisted/blob/trunk/pyproject.toml#L24
python-version: ['3.9', '3.11', 'pypy-3.9']
framework: ['asyncio', 'tw2403', 'twtrunk']
# https://github.blog/changelog/2020-04-15-github-actions-new-workflow-features/
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepscontinue-on-error
continue-on-error: false
steps:
# Checkout sources
- uses: actions/checkout@v3
# Install OS packages, as we install Python packages from source:
#
# libenchant-dev needed for pyenchant, needed for sphinx-spellcheck
# libbz2-dev, libsnappy-dev needed for compression
# libunwind-dev needed for vmprof
#
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install build-essential libssl-dev libffi-dev libunwind-dev \
libreadline-dev zlib1g-dev libbz2-dev libsqlite3-dev libncurses5-dev \
libsnappy-dev libgirepository1.0-dev
# Use this Python
# https://github.com/actions/setup-python/blob/main/README.md
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install Python package dependencies
run: |
python -m pip install -U pip
pip install -U -r requirements-dev.txt
- name: Install this package
run: |
pip install .[all]
- name: Prechecks
run: |
python -c "import autobahn; print(autobahn.__version__)"
python -c "from autobahn import xbr; print(xbr.HAS_XBR)"
python -c "from autobahn.testutil import FakeTransport; print(FakeTransport)"
python -c "import os; print('WEB3_INFURA_PROJECT_ID', len(os.environ.get('WEB3_INFURA_PROJECT_ID', '')))"
python -c "import os; print('WEB3_INFURA_API_SECRET', len(os.environ.get('WEB3_INFURA_API_SECRET', '')))"
# does not work on py3.11
# python -c "from web3.auto.infura import w3; print(w3.isConnected())"
- name: Run unit tests (PyTest)
run: |
tox -c tox.ini -e ${{ matrix.framework }}
docs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Install OS package dependencies
run: |
sudo apt update
sudo apt install libenchant-2-dev libbz2-dev libsnappy-dev libunwind-dev libgirepository1.0-dev
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: '3.11'
architecture: 'x64'
- name: Install Python package dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Install this package and run Sphinx
run: |
pip install .[all]
tox -c tox.ini -e sphinx