Migrate from Travis to Github Actions (#1630)

Migrate from Travis to Github Actions
This commit is contained in:
Ajin Abraham
2020-12-27 19:05:20 -05:00
committed by GitHub
parent 8f60da1e36
commit c15050addb
5 changed files with 62 additions and 83 deletions
-1
View File
@@ -4,7 +4,6 @@
.tox
.dockerignore
.sonarcloud.properties
.travis.yml
.pyup.yml
tox.ini
db.sqlite3
+3 -2
View File
@@ -8,9 +8,10 @@ DESCRIBE THE DETAILS OF PULL REQUEST HERE
### Checklist for PR
- [ ] Run MobSF unit tests and lint `tox -e lint,test`.
- [ ] Run MobSF unit tests and lint `tox -e lint,test`
- [ ] Tested Working on Linux, Mac, Windows, and Docker
- [ ] Make sure build is passing on your PR. [![Build Status](https://travis-ci.com/MobSF/Mobile-Security-Framework-MobSF.svg?branch=master)](https://travis-ci.com/MobSF/Mobile-Security-Framework-MobSF/pull_requests)
- [ ] Add unit test for any new Web API (Refer: `StaticAnalyzer/tests.py`)
- [ ] Make sure tests are passing on your PR [![MobSF tests](https://github.com/MobSF/Mobile-Security-Framework-MobSF/workflows/MobSF%20tests/badge.svg?branch=master)](https://github.com/MobSF/Mobile-Security-Framework-MobSF/actions)
### Additional Comments (if any)
+58
View File
@@ -0,0 +1,58 @@
name: MobSF tests
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macos-latest, windows-latest]
python-version: [3.7, 3.8]
exclude:
# excludes py38 on Windows
- os: windows-latest
python-version: 3.8
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Ubuntu Dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update && sudo apt install -y xfonts-75dpi xfonts-base
export WKHTML_URL=https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/
export WKHTML_DEB=wkhtmltox_0.12.6-1.focal_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 --version 0.12.6
- name: Install Python dependencies
run: |
python -m pip install --upgrade pip wheel tox
pip install --no-index --find-links=scripts/wheels yara-python || (pip wheel --wheel-dir=yara-python --build-option="build" --build-option="--enable-dex" "git+https://github.com/VirusTotal/[email protected]" && pip install --no-index --find-links=yara-python yara-python)
pip install -r requirements.txt
- name: Migrate Database
run: |
python manage.py makemigrations
python manage.py makemigrations StaticAnalyzer
python manage.py migrate
- name: Lint
run: |
tox -e lint
- name: Unit Tests
run: |
git submodule update --init --recursive
python manage.py test
-79
View File
@@ -1,79 +0,0 @@
language: python
name: Ubuntu 18.04
dist: bionic
python:
- '3.6'
- '3.7'
- '3.8'
os: linux
git:
depth: 25
quiet: true
cache: pip
addons:
apt:
packages:
- libpng16-16
- xfonts-75dpi
- xfonts-base
- libffi-dev
- libxml2-dev
- libxslt1-dev
jobs:
include:
- name: Python 3.7.7 on macOS 10.14.6
os: osx
osx_image: xcode11
language: shell
before_install:
- python3 --version
- export WKHTML_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/
- export WKHTML_PKG=wkhtmltox-0.12.5-1.macos-cocoa.pkg
- wget ${WKHTML_URL}${WKHTML_PKG}
- sudo installer -pkg ${WKHTML_PKG} -target /
- name: Python 3.6.8 on Windows 10
os: windows
language: shell
before_install:
- choco install python --version 3.6.8
- python --version
- choco install wkhtmltopdf --version 0.12.5
- choco install openjdk --version 13.0.102
env:
- PATH=/c/Python36:/c/Python36/Scripts:$PATH
- JAVA_HOME="/c/Program Files/OpenJDK/jdk-13.0.2"
- name: Python 3.7.5 on Windows 10
os: windows
language: shell
before_install:
- choco install python --version 3.7.5
- python --version
- choco install wkhtmltopdf --version 0.12.5
- choco install openjdk --version 13.0.102
env:
- PATH=/c/Python37:/c/Python37/Scripts:$PATH
- JAVA_HOME="/c/Program Files/OpenJDK/jdk-13.0.2"
before_install:
- export TRAVIS_COMMIT_MSG="$(git log --format=%B --no-merges -n 1)"
- export WKHTML_URL=https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/
- export WKHTML_DEB=wkhtmltox_0.12.5-1.bionic_amd64.deb
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then wget ${WKHTML_URL}${WKHTML_DEB} && sudo
dpkg -i ${WKHTML_DEB}; fi
install:
- set PYTHONIOENCODING=UTF8
- pip3 install --upgrade pip || python -m pip install --upgrade pip
- pip3 install --upgrade wheel tox
before_script:
- pip3 install --no-index --find-links=scripts/wheels yara-python || (pip3 wheel
--wheel-dir=yara-python --build-option="build" --build-option="--enable-dex" "git+https://github.com/VirusTotal/[email protected]" &&
pip3 install --no-index --find-links=yara-python yara-python)
- pip3 install -r requirements.txt
- python3 manage.py makemigrations || python manage.py makemigrations
- python3 manage.py migrate || python manage.py migrate
- git submodule update --init --recursive
script:
- tox -e lint
- python3 manage.py test || python manage.py test
notifications:
slack:
secure: C5is6tke369xvmcX4RnL+zL7SWYBrwezjTr9FMmQw5/EJwI3Uu73hnIYqZ4Gf/LtYm1bLO0AArSExZbWyEFNI5g87xl94VAM8qafZRBUI7rdNnvt9YMPVGC3pX6fPgh7qY6/ziZ/B2nouSEKsXPIy8pPiHRGjy5y7jC+UmUoYkIan9BXW3Pb6GJC6eUFXZtv7WOuhcnNUlVqWqM81DLqUCVpfCWcrnOMHBqJ91fBqZ/anb9ZjodJBvG6uWIzqnRiaKs7+InG4dogfIOFiNefqi/qom+uwIEbYVFV4MNMPWwtAEbj1IYp6Uygbsg864UWlfmNgsVty5eur3THiMp+oa+tXKONRrjjyG848w6V2+UNKeaGSBxwYv78TBYSk1v7ipUsr+v+DIIcKP1OInm6bWuxoCG6YuliuldIZsS8KXCR7/u7/x5RfAFW8VtgP3JGowJXBCvDkOyNnQTyGVZSyh3ez51YlZb7T6Wqcgj0w0vDiVzWZDcP9AZCEeOzpndP7R+sOOZCS8G6XUSjCZIxOtKl6PAtmdbe7i+WrpCnL3R34yBzKBJAa69yZHKkkk0MlnEDof1g/G1JVu51Q3xEPglRL5eC1nGFRgJf7lhwpbZ/EuWmpRxPpZtTF5DPevC73TWxI4GHVH3tx9VVM3SkQS65M35z+w/nsJzSa3AFfHM=
+1 -1
View File
@@ -10,7 +10,7 @@ Made with ![Love](https://cloud.githubusercontent.com/assets/4301109/16754758/82
[![platform](https://img.shields.io/badge/platform-osx%2Flinux%2Fwindows-green.svg)](https://github.com/MobSF/Mobile-Security-Framework-MobSF/)
[![License](https://img.shields.io/:license-GPL--3.0--only-blue.svg)](https://www.gnu.org/licenses/gpl-3.0.html)
[![Build Status](https://travis-ci.com/MobSF/Mobile-Security-Framework-MobSF.svg?branch=master)](https://travis-ci.com/MobSF/Mobile-Security-Framework-MobSF)
[![MobSF tests](https://github.com/MobSF/Mobile-Security-Framework-MobSF/workflows/MobSF%20tests/badge.svg?branch=master)](https://github.com/MobSF/Mobile-Security-Framework-MobSF/actions)
[![Requirements Status](https://pyup.io/repos/github/MobSF/Mobile-Security-Framework-MobSF/shield.svg)](https://pyup.io/repos/github/MobSF/Mobile-Security-Framework-MobSF/)
[![Language grade: Python](https://img.shields.io/lgtm/grade/python/g/MobSF/Mobile-Security-Framework-MobSF.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/MobSF/Mobile-Security-Framework-MobSF/context:python)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=MobSF_Mobile-Security-Framework-MobSF&metric=alert_status)](https://sonarcloud.io/dashboard?id=MobSF_Mobile-Security-Framework-MobSF)