Merge branch 'MobSF:master' into master #17
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.10', '3.11'] | |
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 and Poetry | |
run: | | |
python -m pip install pip==22.3.1 poetry==1.6.1 | |
- name: Lint on Ubuntu | |
if: startsWith(matrix.os, 'ubuntu') | |
run: | | |
python -m pip install --upgrade tox | |
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 | |
- name: Unit Tests on Ubuntu, macOS and Windows | |
run: | | |
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 |