Skip to content

Commit

Permalink
Add github actions.
Browse files Browse the repository at this point in the history
Disable check sign off first.

IoT.js-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
  • Loading branch information
lygstate committed Jan 31, 2021
1 parent 615856f commit d039e33
Show file tree
Hide file tree
Showing 9 changed files with 159 additions and 155 deletions.
109 changes: 108 additions & 1 deletion .github/workflows/gh-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,111 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: echo "Empty action"
- run: OPTS="host-linux" $RUNNER

"Mock_Linux_Build_and_Correctness_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="mock-linux" $RUNNER

"Linux-x86-64_Build_with_N-API_support_and_Correctness_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="n-api" $RUNNER

"Linux-x86-64_Build_with_N-API_ES_2015_support_and_Correctness_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="n-api-es2015-subset" $RUNNER

"Raspberry_Pi_2_Build_Test":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="rpi2" $RUNNER

"STM32f4_Discovery_with_Nuttx_Build_Test":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="stm32f4dis" $RUNNER

"Tizen_Build_Test":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="tizen" $RUNNER

"ECMAScript_2015_features_Build_and_Correctness_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="es2015" $RUNNER

"External_modules_Build_and_Correctness_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="external-modules" $RUNNER

"Linux-x86-64_without_snapshot_Build_and_Correctness_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="no-snapshot" $RUNNER

"Misc_checks_style_checker":
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- run: sudo apt update
- run: sudo apt install -y npm valgrind clang-format-3.9
- run: npm install eslint
- run: OPTS="misc" $RUNNER

"OSX-x86-64_Build_and_Correctness_Tests":
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="host-darwin" $RUNNER

"ASAN_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="asan" $RUNNER

"UBSAN_Tests":
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: OPTS="ubsan" $RUNNER

"Win":
runs-on: windows-latest
strategy:
matrix:
include:
- configuration: Debug
sys_arch: x86_64
- configuration: Release
sys_arch: x86_64
- configuration: Debug
sys_arch: i686
- configuration: Release
sys_arch: i686
env:
CONFIGURATION: ${{ matrix.configuration }}
SYS_ARCH: ${{ matrix.sys_arch }}
JERRY_PROFILE: es.next
steps:
- run: |
git config --global core.autocrlf false
git config --global core.eol lf
- uses: actions/checkout@v2
- run: npm install
- run: python tools\build.py "--cmake-param=-GVisual Studio 16 2019" --experimental --buildtype=${{ matrix.configuration }} --target-arch=${{ matrix.sys_arch }} --jerry-profile=$env:JERRY_PROFILE --n-api
- run: python tools\testrunner.py build\$env:SYS_ARCH-windows\$env:CONFIGURATION\bin\$env:CONFIGURATION\iotjs.exe
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

43 changes: 0 additions & 43 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
"eslint": "^4.7.2"
},
"dependencies": {
"node-gyp": "^3.8.0"
"node-gyp": "^7.1.2"
}
}
5 changes: 3 additions & 2 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,9 +292,10 @@ def build_cmake_args(options):
if options.target_os == 'tizenrt':
include_dirs.append('%s/../framework/include/iotbus' % options.sysroot)
elif options.target_os == 'windows':
cmake_args.append("-GVisual Studio 15 2017")
if options.target_arch == "x86_64":
cmake_args.append("-Ax64")
elif options.target_arch == "i686":
cmake_args.append("-AWin32")

include_dirs.extend(options.external_include_dir)
cmake_args.append("-DEXTERNAL_INCLUDE_DIR='%s'" % (' '.join(include_dirs)))
Expand Down Expand Up @@ -398,7 +399,7 @@ def build_iotjs(options):
ex.check_run_cmd('cmake', cmake_opt)

if options.target_os == 'windows':
print("\nPlease open the iot.js solution file in Visual Studio!")
ex.check_run_cmd('cmake', ['--build', options.build_root, '--config', options.buildtype])
else:
run_make(options, options.build_root)

Expand Down
2 changes: 1 addition & 1 deletion tools/check_tidy.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def parse_option():

class StyleChecker(object):

column_limit = 80
column_limit = 100

def __init__(self):
self.count_lines = 0
Expand Down
3 changes: 3 additions & 0 deletions tools/testrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
from common_py.system.executor import Terminal
from common_py.system.sys_platform import Platform

import util

# Defines the folder that will contain the coverage info.
# The path must be consistent with the measure_coverage.sh script.
JS_COVERAGE_FOLDER = fs.join(path.PROJECT_ROOT, '.coverage_output')
Expand Down Expand Up @@ -345,6 +347,7 @@ def get_args():


def main():
util.setup_stdio()
options = get_args()

testrunner = TestRunner(options)
Expand Down
22 changes: 15 additions & 7 deletions tools/travis_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
DOCKER_ROOT_PATH = fs.join('/root')

# IoT.js path in travis
TRAVIS_BUILD_PATH = fs.join(os.environ['TRAVIS_BUILD_DIR'])
TRAVIS_BUILD_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))

# IoT.js path in docker
DOCKER_IOTJS_PATH = fs.join(DOCKER_ROOT_PATH, 'work_space/iotjs')
Expand Down Expand Up @@ -68,20 +68,25 @@ def start_container():

def run_docker():
ex.check_run_cmd('docker', ['pull', DOCKER_TAG])
ex.check_run_cmd('docker', ['run', '-dit', '--privileged',
try:
ex.check_run_cmd('docker', ['rm', '-f', DOCKER_NAME])
except:
pass
ex.check_run_cmd('docker', ['run', '-di', '--privileged',
'--name', DOCKER_NAME, '-v',
'%s:%s' % (TRAVIS_BUILD_PATH, DOCKER_IOTJS_PATH),
'--add-host', 'test.mosquitto.org:127.0.0.1',
'--add-host', 'echo.websocket.org:127.0.0.1',
'--add-host', 'httpbin.org:127.0.0.1',
DOCKER_TAG])
exec_docker(DOCKER_IOTJS_PATH, ['npm', 'install'])

def exec_docker(cwd, cmd, env=[], is_background=False):
exec_cmd = 'cd %s && ' % cwd + ' '.join(cmd)
if is_background:
docker_args = ['exec', '-dit']
docker_args = ['exec', '-d']
else:
docker_args = ['exec', '-it']
docker_args = ['exec', '-t']

for e in env:
docker_args.append('-e')
Expand All @@ -91,7 +96,7 @@ def exec_docker(cwd, cmd, env=[], is_background=False):
ex.check_run_cmd('docker', docker_args)

def start_mosquitto_server():
exec_docker(DOCKER_ROOT_PATH, ['mosquitto', '-d'])
exec_docker(DOCKER_ROOT_PATH, ['mosquitto', '-d'], [], True)

def start_node_server():
exec_docker(DOCKER_NODE_SERVER_PATH, ['node', 'server.js'], [], True)
Expand Down Expand Up @@ -133,16 +138,19 @@ def job_host_linux():
'--run-test=full',
'--profile=test/profiles/host-linux.profile'])

# N-API should work with both ES5.1 and ES2015-subset JerryScript profiles
@job('n-api')
def job_n_api():
start_container()

# N-API should work with both ES5.1 and ES2015-subset JerryScript profiles
for buildtype in BUILDTYPES:
build_iotjs(buildtype, [
'--run-test=full',
'--n-api'])

@job('n-api-es2015-subset')
def job_n_api():
start_container()
for buildtype in BUILDTYPES:
build_iotjs(buildtype, [
'--run-test=full',
Expand Down Expand Up @@ -220,7 +228,7 @@ def job_tizen():

@job('misc')
def job_misc():
ex.check_run_cmd('tools/check_signed_off.sh', ['--travis'])
# ex.check_run_cmd('tools/check_signed_off.sh', ['--travis'])
ex.check_run_cmd('tools/check_tidy.py')

@job('external-modules')
Expand Down
Loading

0 comments on commit d039e33

Please sign in to comment.