-
Notifications
You must be signed in to change notification settings - Fork 1
144 lines (123 loc) · 4.53 KB
/
python-package.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
144
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on: push
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- uses: actions/checkout@v2
- name: Install APT dependencies
run: |
sudo apt-get install redis-server
curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O
sudo apt-get install ./google-chrome-stable_current_amd64.deb
CHROME_MAIN_VERSION=`google-chrome-stable --version | sed -E 's/(^Google Chrome |\.[0-9]+ )//g'`
echo "using chrome version $CHROME_MAIN_VERSION"
CHROMEDRIVER_VERSION=`curl -s "https://googlechromelabs.github.io/chrome-for-testing/LATEST_RELEASE_$CHROME_MAIN_VERSION"`
echo "using driver version $CHROMEDRIVER_VERSION"
curl "https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/${CHROMEDRIVER_VERSION}/linux64/chromedriver-linux64.zip" -O
unzip chromedriver-linux64.zip -d ~/bin
ulimit -c unlimited -S # enable core dumps
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip (Linux)
if: startsWith(runner.os, 'Linux')
uses: actions/cache@v2
with:
# This path is specific to Ubuntu
path: ~/.cache/pip
# Look to see if there is a cache hit for the corresponding requirements file
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache pip (MacOS)
if: startsWith(runner.os, 'macOS')
uses: actions/cache@v2
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('Pipfile.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install PIP dependencies
timeout-minutes: 15 # Should run in ~2 to 3 min with cache
run: |
echo 'UPGRADE PIP'
pip install --upgrade pip==21.2.4 pip-tools wheel
echo 'INSTALL DEV REQUIREMENTS'
pip install --requirement dev-requirements.lock
echo 'INSTALL odb in editable mode'
pip install --editable .
echo 'Import ODB and see that it built correctly'
python3 -c 'import object_database._types'
- name: Install NODE dependencies
timeout-minutes: 3 # Runs in ~30 sec
run: |
make node-install
make build-js
# - name: Setup Debug SSH Session
# uses: mxschmitt/action-tmate@v3
- name: Test JS
timeout-minutes: 3 # runs in ~10 sec
env:
TRAVIS_CI: 1
run: |
make js-test
- name: Test Python
timeout-minutes: 20 # Runs in ~10 min
env:
TRAVIS_CI: 1
PYTHONUNBUFFERED: true
run: |
make testcert.cert
pytest --verbose --capture=no --log-level=info --log-cli-level=info
pip-install:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
steps:
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: pip install object_database from github
timeout-minutes: 10 # Runs in ~3 min
run: |
python --version
pip --version
pip freeze
pip install -v git+https://github.com/APrioriInvestments/object_database.git@${GITHUB_SHA}
- name: import object_database
timeout-minutes: 1 # Runs in <10 sec
run : |
pip freeze
python -c "import typed_python"
python -c "import object_database"
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: 3.7
- name: Install dependencies
timeout-minutes: 2 # Runs in 15 sec
run: |
python -m pip install --upgrade pip
pip install flake8==3.8.4 safety black==19.3b0
- name: Check black and lint
timeout-minutes: 2 # Runs in 15 sec
run: |
pip install --upgrade pip pip-tools wheel
pip install --requirement dev-requirements.lock
make lint-local
make black-check-local