Skip to content

Commit 655b965

Browse files
committed
Add github actions.
Disable check sign off first. Rename to ci_script.py IoT.js-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
1 parent 3863c65 commit 655b965

File tree

11 files changed

+201
-164
lines changed

11 files changed

+201
-164
lines changed

.github/workflows/gh-actions.yml

+126-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,135 @@ name: IoT.js CI
33
on: [push, pull_request]
44

55
env:
6-
RUNNER: tools/travis_script.py
6+
RUNNER: tools/ci_script.py
77

88
jobs:
99
"Linux-x86-64_Build_and_Correctness_Tests":
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13-
- run: echo "Empty action"
13+
- run: OPTS="host-linux" $RUNNER
14+
15+
"Mock_Linux_Build_and_Correctness_Tests":
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v2
19+
- run: OPTS="mock-linux" $RUNNER
20+
21+
"Linux-x86-64_Build_with_N-API_support_and_Correctness_Tests":
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v2
25+
- run: OPTS="n-api" $RUNNER
26+
27+
"Linux-x86-64_Build_with_N-API_ES_2015_support_and_Correctness_Tests":
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v2
31+
- run: OPTS="n-api-es2015-subset" $RUNNER
32+
33+
"Raspberry_Pi_2_Build_Test":
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v2
37+
- run: OPTS="rpi2" $RUNNER
38+
39+
"STM32f4_Discovery_with_Nuttx_Build_Test":
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v2
43+
- run: OPTS="stm32f4dis" $RUNNER
44+
45+
"Tizen_Build_Test":
46+
runs-on: ubuntu-latest
47+
steps:
48+
- uses: actions/checkout@v2
49+
- run: OPTS="tizen" $RUNNER
50+
51+
"ECMAScript_2015_features_Build_and_Correctness_Tests":
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v2
55+
- run: OPTS="es2015" $RUNNER
56+
57+
"External_modules_Build_and_Correctness_Tests":
58+
runs-on: ubuntu-latest
59+
steps:
60+
- uses: actions/checkout@v2
61+
- run: OPTS="external-modules" $RUNNER
62+
63+
"Linux-x86-64_without_snapshot_Build_and_Correctness_Tests":
64+
runs-on: ubuntu-latest
65+
steps:
66+
- uses: actions/checkout@v2
67+
- run: OPTS="no-snapshot" $RUNNER
68+
69+
"Misc_checks_style_checker":
70+
runs-on: ubuntu-18.04
71+
steps:
72+
- uses: actions/checkout@v2
73+
- run: sudo apt update
74+
- run: sudo apt install -y npm clang-format-3.9
75+
- run: npm install eslint
76+
- run: OPTS="misc" $RUNNER
77+
78+
"OSX-x86-64_Build_and_Correctness_Tests":
79+
runs-on: macos-latest
80+
steps:
81+
- uses: actions/checkout@v2
82+
- run: OPTS="host-darwin" $RUNNER
83+
84+
"ASAN_Tests":
85+
runs-on: ubuntu-latest
86+
steps:
87+
- uses: actions/checkout@v2
88+
- run: OPTS="asan" $RUNNER
89+
90+
"UBSAN_Tests":
91+
runs-on: ubuntu-latest
92+
steps:
93+
- uses: actions/checkout@v2
94+
- run: OPTS="ubsan" $RUNNER
95+
96+
"Windows-x86_64":
97+
runs-on: windows-latest
98+
strategy:
99+
matrix:
100+
include:
101+
- configuration: Debug
102+
- configuration: Release
103+
steps:
104+
- run: |
105+
git config --global core.autocrlf false
106+
git config --global core.eol lf
107+
- uses: actions/checkout@v2
108+
- run: npm install
109+
- run: python tools\build.py "--cmake-param=-GVisual Studio 16 2019"
110+
--experimental
111+
--buildtype=${{ matrix.configuration }}
112+
--target-arch=x86_64
113+
--run-test=full
114+
--jerry-profile=es.next
115+
--profile=test/profiles/host-windows.profile
116+
117+
"Windows-i686":
118+
runs-on: windows-latest
119+
strategy:
120+
matrix:
121+
include:
122+
- configuration: Debug
123+
- configuration: Release
124+
steps:
125+
- run: |
126+
git config --global core.autocrlf false
127+
git config --global core.eol lf
128+
- uses: actions/checkout@v2
129+
- run: npm install
130+
- run: python tools\build.py "--cmake-param=-GVisual Studio 16 2019"
131+
--experimental
132+
--buildtype=${{ matrix.configuration }}
133+
--target-arch=i686
134+
--run-test=full
135+
--jerry-cmake-param=-DJERRY_SYSTEM_ALLOCATOR=ON
136+
--jerry-profile=es5.1
137+
--profile=test/profiles/host-windows.profile

.travis.yml

-100
This file was deleted.

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
9494
iotjs_add_compile_flags(-wd4668)
9595
# disable warning C4100: unreferenced formal parameter
9696
iotjs_add_compile_flags(-wd4100)
97+
iotjs_add_compile_flags(-wd4242)
98+
iotjs_add_compile_flags(-wd4244)
99+
iotjs_add_compile_flags(-wd4996)
100+
iotjs_add_compile_flags(-wd4061)
101+
iotjs_add_compile_flags(-wd5045)
102+
iotjs_add_compile_flags(-wd4701)
103+
iotjs_add_compile_flags(-wd4710)
97104
endif()
98105

99106
CHECK_C_COMPILER_FLAG(-no-pie HAS_NO_PIE)

appveyor.yml

-43
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@
1111
"eslint": "^4.7.2"
1212
},
1313
"dependencies": {
14-
"node-gyp": "^3.8.0"
14+
"node-gyp": "^7.1.2"
1515
}
1616
}

test/profiles/host-darwin.profile

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
ENABLE_MODULE_IOTJS_BASIC_MODULES
22
ENABLE_MODULE_IOTJS_CORE_MODULES
33
ENABLE_MODULE_HTTPS
4+
ENABLE_MODULE_NAPI

test/profiles/host-windows.profile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ENABLE_MODULE_IOTJS_BASIC_MODULES
2+
ENABLE_MODULE_IOTJS_CORE_MODULES
3+
ENABLE_MODULE_HTTPS
4+
ENABLE_MODULE_NAPI

tools/build.py

+13-8
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,10 @@ def build_cmake_args(options):
291291
if options.target_os == 'tizenrt':
292292
include_dirs.append('%s/../framework/include/iotbus' % options.sysroot)
293293
elif options.target_os == 'windows':
294-
cmake_args.append("-GVisual Studio 15 2017")
295294
if options.target_arch == "x86_64":
296295
cmake_args.append("-Ax64")
296+
elif options.target_arch == "i686":
297+
cmake_args.append("-AWin32")
297298

298299
include_dirs.extend(options.external_include_dir)
299300
cmake_args.append("-DEXTERNAL_INCLUDE_DIR='%s'" % (' '.join(include_dirs)))
@@ -397,16 +398,18 @@ def build_iotjs(options):
397398
ex.check_run_cmd('cmake', cmake_opt)
398399

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

404405

405406
def run_checktest(options):
406407
# IoT.js executable
407408
iotjs = fs.join(options.build_root, 'bin', 'iotjs')
408-
409-
cmd = fs.join(path.TOOLS_ROOT, 'testrunner.py')
409+
if options.target_os == 'windows':
410+
iotjs = fs.join(options.build_root, 'bin', options.buildtype, 'iotjs')
411+
cmd = sys.executable
412+
testrunner_script = fs.join(path.TOOLS_ROOT, 'testrunner.py')
410413
args = [iotjs, "--platform=%s" % options.target_os]
411414

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

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

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

@@ -466,7 +469,9 @@ def run_checktest(options):
466469
(options.host_tuple == 'x86_64-linux' and
467470
options.target_tuple == 'i686-linux') or
468471
(options.host_tuple == 'x86_64-linux' and
469-
options.target_tuple == 'x86_64-mock')):
472+
options.target_tuple == 'x86_64-mock') or
473+
(options.host_tuple == 'x86_64-windows' and
474+
options.target_tuple == 'i686-windows')):
470475
run_checktest(options)
471476
else:
472477
print("Skip unit tests - target-host pair is not allowed\n")

0 commit comments

Comments
 (0)