-
Notifications
You must be signed in to change notification settings - Fork 21
85 lines (73 loc) · 2.56 KB
/
nosetests.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
name: Python application
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8, 3.9, "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{matrix.python-version}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python-version}}
- name: Install system dependencies
run: |
sudo apt install p7zip-full mercurial p7zip-rar
# Testing dependencies
sudo apt-get install rar git
# filecheck.py dependencies
sudo apt install libxml2-dev libxslt1-dev
- name: Install Python dependencies
run: |
wget https://didierstevens.com/files/software/pdfid_v0_2_7.zip
unzip pdfid_v0_2_7.zip
pip install -U poetry
poetry install
- name: Get testing files
run: |
# Malware from theZoo
git clone https://github.com/Rafiot/theZoo.git
pushd theZoo/malwares/Binaries
python3 unpackall.py
popd
mkdir tests/uncategorized/the_zoo/
mv theZoo/malwares/Binaries/out tests/uncategorized/the_zoo/
# Path traversal attacks
git clone https://github.com/jwilk/path-traversal-samples
pushd path-traversal-samples
pushd zip
make
popd
pushd rar
make
popd
popd
mkdir tests/uncategorized/path_traversal_zip/
mkdir tests/uncategorized/path_traversal_rar/
mv path-traversal-samples/zip/*.zip tests/uncategorized/path_traversal_zip
mv path-traversal-samples/rar/*.rar tests/uncategorized/path_traversal_rar
# Office docs
git clone https://github.com/eea/odfpy.git
mkdir tests/uncategorized/odfpy/
mv odfpy/tests/examples/* tests/uncategorized/odfpy/
mkdir tests/uncategorized/olefile
pushd tests/uncategorized/olefile
wget https://github.com/decalage2/olefile/raw/master/tests/images/test-ole-file.doc
popd
#mkdir tests/uncategorized/fraunhofer && pushd tests/uncategorized/fraunhofer
#wget --no-check-certificate https://www.officedissector.com/corpus/fraunhoferlibrary.zip
#unzip -o fraunhoferlibrary.zip
#rm fraunhoferlibrary.zip
#popd
- name: Test
run: |
poetry run mypy kittengroomer/ filecheck/ tests/ scripts/ --ignore-missing-imports
poetry run py.test --cov=kittengroomer --cov=filecheck tests/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3