-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
84 lines (70 loc) · 2.49 KB
/
mobsf-test.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
name: MobSF tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
MOBSF_DISABLE_AUTHENTICATION: "1"
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, macos-latest, windows-latest]
python-version: ['3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Setup pip, poetry and tox
run: |
python -m ensurepip --upgrade
python -m pip install pip poetry==1.8.4
python -m pip install --upgrade setuptools tox
- name: Lint on Ubuntu
if: startsWith(matrix.os, 'ubuntu')
run: |
tox -e lint
- name: Install Ubuntu Dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update && sudo apt install -y xfonts-75dpi xfonts-base libssl3
export WKHTML_URL=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6.1-2/
export WKHTML_DEB=wkhtmltox_0.12.6.1-2.jammy_amd64.deb
wget ${WKHTML_URL}${WKHTML_DEB} && sudo dpkg -i ${WKHTML_DEB} && rm -rf ${WKHTML_DEB}
- name: Install macOS Dependencies
if: startsWith(matrix.os, 'macOS')
run: |
brew install --cask wkhtmltopdf
- name: Install Windows Dependencies
if: startsWith(matrix.os, 'windows')
run: |
choco install wkhtmltopdf
- name: Install Python dependencies
run: |
poetry install --only main --no-root --no-interaction --no-ansi || poetry install --only main --no-root --no-interaction --no-ansi || poetry install --only main --no-root --no-interaction --no-ansi
- name: Migrate Database
run: |
poetry run python manage.py makemigrations
poetry run python manage.py makemigrations StaticAnalyzer
poetry run python manage.py migrate
poetry run python manage.py create_roles
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Unit Tests on Ubuntu, macOS and Windows
run: |
java -version
git submodule update --init --recursive
poetry run python manage.py test mobsf
- name: Python Package Test in Ubuntu and macOS
if: startsWith(matrix.os, 'ubuntu') || startsWith(matrix.os, 'macOS')
run: |
poetry build
python -m pip install dist/*.whl
mobsf db