Skip to content

Commit

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

IoT.js-DCO-1.0-Signed-off-by: Yonggang Luo [email protected]
  • Loading branch information
lygstate committed Feb 9, 2021
1 parent eb3497a commit 54c32f9
Show file tree
Hide file tree
Showing 11 changed files with 202 additions and 164 deletions.
129 changes: 127 additions & 2 deletions .github/workflows/gh-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,136 @@ name: IoT.js CI
on: [push, pull_request]

env:
RUNNER: tools/travis_script.py
RUNNER: tools/ci_script.py

jobs:
"Linux-x86-64_Build_and_Correctness_Tests":
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 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

"Windows-x86_64":
runs-on: windows-latest
strategy:
matrix:
include:
- configuration: Debug
- configuration: Release
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=x86_64
--run-test=full
--jerry-cmake-param=-DJERRY_CPOINTER_32_BIT=ON
--jerry-profile=es.next
--profile=test/profiles/host-windows.profile

"Windows-i686":
runs-on: windows-latest
strategy:
matrix:
include:
- configuration: Debug
- configuration: Release
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=i686
--run-test=full
--jerry-cmake-param=-DJERRY_SYSTEM_ALLOCATOR=ON
--jerry-profile=es5.1
--profile=test/profiles/host-windows.profile
100 changes: 0 additions & 100 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
iotjs_add_compile_flags(-wd4668)
# disable warning C4100: unreferenced formal parameter
iotjs_add_compile_flags(-wd4100)
iotjs_add_compile_flags(-wd4242)
iotjs_add_compile_flags(-wd4244)
iotjs_add_compile_flags(-wd4996)
iotjs_add_compile_flags(-wd4061)
iotjs_add_compile_flags(-wd5045)
iotjs_add_compile_flags(-wd4701)
iotjs_add_compile_flags(-wd4710)
endif()

CHECK_C_COMPILER_FLAG(-no-pie HAS_NO_PIE)
Expand Down
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"
}
}
1 change: 1 addition & 0 deletions test/profiles/host-darwin.profile
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
ENABLE_MODULE_IOTJS_BASIC_MODULES
ENABLE_MODULE_IOTJS_CORE_MODULES
ENABLE_MODULE_HTTPS
ENABLE_MODULE_NAPI
4 changes: 4 additions & 0 deletions test/profiles/host-windows.profile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ENABLE_MODULE_IOTJS_BASIC_MODULES
ENABLE_MODULE_IOTJS_CORE_MODULES
ENABLE_MODULE_HTTPS
ENABLE_MODULE_NAPI
21 changes: 13 additions & 8 deletions tools/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,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 @@ -397,16 +398,18 @@ 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)


def run_checktest(options):
# IoT.js executable
iotjs = fs.join(options.build_root, 'bin', 'iotjs')

cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
if options.target_os == 'windows':
iotjs = fs.join(options.build_root, 'bin', options.buildtype, 'iotjs')
cmd = sys.executable
testrunner_script = fs.join(path.TOOLS_ROOT, 'testrunner.py')
args = [iotjs, "--platform=%s" % options.target_os]

if options.run_test == "quiet":
Expand All @@ -425,12 +428,12 @@ def run_checktest(options):
env['CC'] = 'i686-linux-gnu-gcc'
env['CXX'] = 'i686-linux-gnu-g++'

code = ex.run_cmd(cmd, args, env=env)
code = ex.run_cmd(cmd, [testrunner_script] + args, env=env)
if code != 0:
ex.fail('Failed to pass unit tests')

if not options.no_check_valgrind:
code = ex.run_cmd(cmd, ['--valgrind'] + args, env=env)
if not options.no_check_valgrind and options.target_os != 'windows':
code = ex.run_cmd(cmd, [testrunner_script, '--valgrind'] + args, env=env)
if code != 0:
ex.fail('Failed to pass unit tests in valgrind environment')

Expand Down Expand Up @@ -466,7 +469,9 @@ def run_checktest(options):
(options.host_tuple == 'x86_64-linux' and
options.target_tuple == 'i686-linux') or
(options.host_tuple == 'x86_64-linux' and
options.target_tuple == 'x86_64-mock')):
options.target_tuple == 'x86_64-mock') or
(options.host_tuple == 'x86_64-windows' and
options.target_tuple == 'i686-windows')):
run_checktest(options)
else:
print("Skip unit tests - target-host pair is not allowed\n")
Expand Down
Loading

0 comments on commit 54c32f9

Please sign in to comment.