migrate travis to actions

pull/66/head
cfig 4 years ago
parent a67ff9e4db
commit 2d5a7b7019
No known key found for this signature in database
GPG Key ID: B104C307F0FDABB7

@ -0,0 +1,98 @@
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
branches: [ rc, master ]
pull_request:
branches: [ ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
linux:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: apt
run: sudo apt install device-tree-compiler
# Runs a single command using the runners shell
- name: Unit Test
run: ./gradlew check && ./gradlew clean
# Runs a set of commands using the runners shell
- name: Integration Test
run: |
./integrationTest.py
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: brew
run: brew install dtc
- name: Unit Test
run: ./gradlew check && ./gradlew clean
# Runs a set of commands using the runners shell
- name: Integration Test
run: ./integrationTest.py
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: choco
run: choco install openssl
- name: Unit Test
run: ./gradlew.bat check && ./gradlew.bat clean
# Runs a set of commands using the runners shell
- name: Integration Test
run: python integrationTest.py

@ -1,26 +0,0 @@
branches:
only:
- master
- dev
language: java
os:
- linux
- osx
dist: focal
osx_image: xcode12.2
addons:
apt:
packages:
- xz-utils
- libblkid-dev
- liblz4-tool
- device-tree-compiler
- python3
- python-all
before_install:
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update ; fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew install lz4 dtc ; fi
before_script:
- ./gradlew check && ./gradlew clean
script:
- ./integrationTest.py

@ -1,5 +1,5 @@
# Android_boot_image_editor
[![Build Status](https://www.travis-ci.com/cfig/Android_boot_image_editor.svg?branch=master)](https://www.travis-ci.com/cfig/Android_boot_image_editor)
[![CI](https://github.com/cfig/Android_boot_image_editor/actions/workflows/main.yml/badge.svg)](https://github.com/cfig/Android_boot_image_editor/actions/workflows/main.yml)
[![License](http://img.shields.io/:license-apache-blue.svg?style=flat-square)](http://www.apache.org/licenses/LICENSE-2.0.html)
A tool for reverse engineering Android ROM images.
@ -8,7 +8,7 @@ A tool for reverse engineering Android ROM images.
#### install required packages
Mac: `brew install lz4 xz`
Mac: `brew install lz4 xz dtc`
Linux: `sudo apt install git device-tree-compiler lz4 xz-utils zlib1g-dev openjdk-11-jdk gcc g++ python3`

@ -421,7 +421,7 @@ data class BootV2(
private fun toCommandLine(): CommandLine {
val cmdPrefix = if (EnvironmentVerifier().isWindows) "python " else ""
val ret = CommandLine(cmdPrefix + Helper.prop("mkbootimg"))
val ret = CommandLine.parse(cmdPrefix + Helper.prop("mkbootimg"))
ret.addArgument(" --header_version ")
ret.addArgument(info.headerVersion.toString())
ret.addArgument(" --base ")

@ -206,7 +206,7 @@ data class BootV3(var info: MiscInfo = MiscInfo(),
private fun toCommandLine(): CommandLine {
val cmdPrefix = if (EnvironmentVerifier().isWindows) "python " else ""
return CommandLine(cmdPrefix + Helper.prop("mkbootimg")).let { ret ->
return CommandLine.parse(cmdPrefix + Helper.prop("mkbootimg")).let { ret ->
ret.addArgument("--header_version")
ret.addArgument(info.headerVersion.toString())
if (kernel.size > 0) {

@ -77,16 +77,24 @@ tasks {
if (bHackingMode) {
logger.info("Hacking mode!")
//C++ mkbootfs
if (System.getProperty("os.name").contains("Mac")) {
//mac
unpackTask.dependsOn("aosp:libsparse:simg2img:installReleaseMacos")
packTask.dependsOn("aosp:libsparse:img2simg:installReleaseMacos")
// common
packTask.dependsOn("aosp:mkbootfs.10:mkbootfsExecutable")
packTask.dependsOn("aosp:mkbootfs.11:mkbootfsExecutable")
unpackTask.dependsOn("aosp:mkbootfs.10:mkbootfsExecutable")
unpackTask.dependsOn("aosp:mkbootfs.11:mkbootfsExecutable")
if (System.getProperty("os.name").contains("Mac")) {
unpackTask.dependsOn("aosp:libsparse:simg2img:installReleaseMacos")
packTask.dependsOn("aosp:libsparse:img2simg:installReleaseMacos")
} else if (System.getProperty("os.name").contains("Linux")) {
//linux
unpackTask.dependsOn("aosp:libsparse:simg2img:installReleaseLinux")
packTask.dependsOn("aosp:libsparse:img2simg:installReleaseLinux")
// common
packTask.dependsOn("aosp:mkbootfs.10:mkbootfsExecutable")
packTask.dependsOn("aosp:mkbootfs.11:mkbootfsExecutable")
unpackTask.dependsOn("aosp:mkbootfs.10:mkbootfsExecutable")
unpackTask.dependsOn("aosp:mkbootfs.11:mkbootfsExecutable")
} else {
logger.info("Disable C++ modules on Window$")
}

4
gradlew.bat vendored

@ -14,6 +14,10 @@
@rem limitations under the License.
@rem
@rem set path for lz4
@IF EXIST tools\bin SET PATH=%PATH%;tools\bin
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem

Binary file not shown.
Loading…
Cancel
Save