99 lines (88 loc) · 3.45 KB
/
tests_multi_os.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
name: tests
on: [push, pull_request]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
max-parallel: 6
matrix:
os: [ubuntu-18.04, windows-latest, macOS-latest]
python-version: ["3.6", "3.7"]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
# - uses: actions/cache@v1
# id: devcache
# with:
# path: ~/.cache/pip
# key: ${{ runner.os }}-pip-dev-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ runner.os }}-pip-
- name: Install
# if: steps.devcache.outputs.cache-hit != 'true'
run: |
git submodule update --init --recursive
pip install -r requirements.txt
python -m pip install --upgrade pip
pip install .[extras]
- name: Install test requirements
run: |
pip install sphinx recommonmark pytest pytest-cov bandit pyperclip
- name: Test with pytest
run: |
pytest --disable-pytest-warnings --cov-report=xml --cov=chepy --cov-config=.coveragerc tests/
coverage report -m
- name: Test plugins osx
if: matrix.os == 'macOS-latest'
run: |
sed -iE 's/enableplugins = false/enableplugins = true/' ~/.chepy/chepy.conf
sed -iE '/chepy/d' chepy/chepy_plugins/requirements.txt
pip install -r chepy/chepy_plugins/requirements.txt
pytest --disable-pytest-warnings tests_plugins/
python -c "from chepy import Chepy"
- name: Test plugins ubuntu
if: contains(matrix.os, 'ubuntu')
run: |
sed -i 's/enableplugins = false/enableplugins = true/' ~/.chepy/chepy.conf
sed -i '/chepy/d' chepy/chepy_plugins/requirements.txt
pip install -r chepy/chepy_plugins/requirements.txt
pytest --disable-pytest-warnings tests_plugins/
python -c "from chepy import Chepy"
- name: Test plugins windows
if: matrix.os == 'windows-latest'
run: |
Set-Content -Path ~/.chepy/chepy.conf -Value (Get-Content ~/.chepy/chepy.conf | %{$_ -replace "enableplugins = false","enableplugins = true"})
Set-Content -Path chepy/chepy_plugins/requirements.txt -Value (Get-Content -Path chepy/chepy_plugins/requirements.txt | Select-String -Pattern 'chepy' -NotMatch)
pip install -r chepy/chepy_plugins/requirements.txt
pytest --disable-pytest-warnings tests_plugins/
python -c "from chepy import Chepy"
- name: Test with bandit
run: |
bandit --recursive chepy/ --ignore-nosec --skip B101,B413,B303,B310,B112,B304,B320,B410,B404
- name: Test docs
run: |
make -C docs/ clean html
- name: Upload to codecov
if: startsWith(matrix.os,'ubuntu')
uses: codecov/codecov-action@v1.0.3
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml
# - name: Run pyinstaller
# if: startsWith(matrix.python-version,'3.7')
# run: |
# ls -l
# ls -l ../
# pyinstaller cli.py --name chepy --onefile
# - name: Upload pyinstaller build
# if: startsWith(matrix.python-version,'3.7')
# run: |
# pyinstaller cli.py --name chepy --onefile
# uses: actions/upload-artifact@v1
# with:
# name: chepy-${{ matrix.os }}-{{ matrix.python-version }}
# path: dist/chepy