Skip to content

Commit

Permalink
ℹ️
Browse files Browse the repository at this point in the history
ℹ️ moved builds to dev_requirements.txt
ℹ️ updates to Dockerfile and GHA
  • Loading branch information
securisecctf committed Dec 3, 2019
1 parent b39a083 commit d4a69f9
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 106 deletions.
102 changes: 3 additions & 99 deletions .github/workflows/tests_multi_os.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ name: tests
on: [push, pull_request]

jobs:
linux:
test:

runs-on: ubuntu-18.04
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 4
matrix:
os: [ubuntu-18.04, windows-latest, macOS-latest]
python-version: [3.6, 3.7, 3.8]

steps:
Expand All @@ -17,13 +18,6 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v1
id: cache
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v1
id: devcache
with:
Expand Down Expand Up @@ -52,93 +46,3 @@ jobs:
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ./coverage.xml

windows:

runs-on: windows-latest
strategy:
max-parallel: 4
matrix:
python-version: [3.6, 3.7, 3.8]

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: cache
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v1
id: devcache
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-pip-${{ hashFiles('**/dev_requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-dev-
- name: Install
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r dev_requirements.txt
python -m pip install --upgrade pip
pip install .
- name: Test with pytest
run: |
pytest --disable-pytest-warnings --cov-report=xml --cov=chepy --cov-config=.coveragerc tests/
coverage report -m
- 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
osx:

runs-on: macOS-latest
strategy:
max-parallel: 4
matrix:
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: cache
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- uses: actions/cache@v1
id: devcache
with:
path: ~/Library/Caches/pip
key: ${{ runner.os }}-pip-dev-${{ hashFiles('**/dev_requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-dev-
- name: Install
if: steps.cache.outputs.cache-hit != 'true'
run: |
pip install -r dev_requirements.txt
python -m pip install --upgrade pip
pip install .
- name: Test with pytest
run: |
pytest --disable-pytest-warnings --cov-report=xml --cov=chepy --cov-config=.coveragerc tests/
coverage report -m
- 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
10 changes: 4 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
FROM python:3.8.0

WORKDIR /chepy
COPY requirements.txt /chepy
RUN pip install -r /chepy/requirements.txt \
&& pip install pytest pytest-cov sphinx bandit recommonmark virtualenv

COPY Pipfile* /chepy/
RUN virtualenv -p python3 /chepy/venv
COPY dev_requirements.txt /chepy
RUN pip install -r /chepy/dev_requirements.txt \
&& virtualenv -p python3 /chepy/venv \
&& /chepy/venv/bin/pip3 install -r dev_requirements.txt

COPY . /chepy/
RUN cd /chepy && venv/bin/pip3 install .
Expand Down
36 changes: 35 additions & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
base58
colorama
crccheck
decorator
docstring-parser
emoji
fire==0.2.1
hachoir==3.1.0
hashid
hexdump
jsonpath-rw
jsonpickle
parsel
phpserialize
Pillow
prompt_toolkit
pycipher
pycryptodome
pydash
pyjwt
pyOpenSSL
pyperclip
PyExifTool
PyYAML
regex
requests
requests-toolbelt
scapy
ua-parser
ujson

# Dev

pytest
pytest-cov
bandit
sphinx
recommonmark
recommonmark
virtualenv

0 comments on commit d4a69f9

Please sign in to comment.