Skip to content

Commit d039e33

Browse files
committed
Add github actions.
Disable check sign off first. IoT.js-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
1 parent 615856f commit d039e33

File tree

9 files changed

+159
-155
lines changed

9 files changed

+159
-155
lines changed

Diff for: .github/workflows/gh-actions.yml

+108-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,111 @@ jobs:
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 valgrind 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+
"Win":
97+
runs-on: windows-latest
98+
strategy:
99+
matrix:
100+
include:
101+
- configuration: Debug
102+
sys_arch: x86_64
103+
- configuration: Release
104+
sys_arch: x86_64
105+
- configuration: Debug
106+
sys_arch: i686
107+
- configuration: Release
108+
sys_arch: i686
109+
env:
110+
CONFIGURATION: ${{ matrix.configuration }}
111+
SYS_ARCH: ${{ matrix.sys_arch }}
112+
JERRY_PROFILE: es.next
113+
steps:
114+
- run: |
115+
git config --global core.autocrlf false
116+
git config --global core.eol lf
117+
- uses: actions/checkout@v2
118+
- run: npm install
119+
- 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
120+
- run: python tools\testrunner.py build\$env:SYS_ARCH-windows\$env:CONFIGURATION\bin\$env:CONFIGURATION\iotjs.exe

Diff for: .travis.yml

-100
This file was deleted.

Diff for: appveyor.yml

-43
This file was deleted.

Diff for: 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
}

Diff for: tools/build.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ def build_cmake_args(options):
292292
if options.target_os == 'tizenrt':
293293
include_dirs.append('%s/../framework/include/iotbus' % options.sysroot)
294294
elif options.target_os == 'windows':
295-
cmake_args.append("-GVisual Studio 15 2017")
296295
if options.target_arch == "x86_64":
297296
cmake_args.append("-Ax64")
297+
elif options.target_arch == "i686":
298+
cmake_args.append("-AWin32")
298299

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

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

Diff for: tools/check_tidy.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def parse_option():
4444

4545
class StyleChecker(object):
4646

47-
column_limit = 80
47+
column_limit = 100
4848

4949
def __init__(self):
5050
self.count_lines = 0

Diff for: tools/testrunner.py

+3
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@
3838
from common_py.system.executor import Terminal
3939
from common_py.system.sys_platform import Platform
4040

41+
import util
42+
4143
# Defines the folder that will contain the coverage info.
4244
# The path must be consistent with the measure_coverage.sh script.
4345
JS_COVERAGE_FOLDER = fs.join(path.PROJECT_ROOT, '.coverage_output')
@@ -345,6 +347,7 @@ def get_args():
345347

346348

347349
def main():
350+
util.setup_stdio()
348351
options = get_args()
349352

350353
testrunner = TestRunner(options)

Diff for: tools/travis_script.py

+15-7
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
DOCKER_ROOT_PATH = fs.join('/root')
2727

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

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

6969
def run_docker():
7070
ex.check_run_cmd('docker', ['pull', DOCKER_TAG])
71-
ex.check_run_cmd('docker', ['run', '-dit', '--privileged',
71+
try:
72+
ex.check_run_cmd('docker', ['rm', '-f', DOCKER_NAME])
73+
except:
74+
pass
75+
ex.check_run_cmd('docker', ['run', '-di', '--privileged',
7276
'--name', DOCKER_NAME, '-v',
7377
'%s:%s' % (TRAVIS_BUILD_PATH, DOCKER_IOTJS_PATH),
7478
'--add-host', 'test.mosquitto.org:127.0.0.1',
7579
'--add-host', 'echo.websocket.org:127.0.0.1',
7680
'--add-host', 'httpbin.org:127.0.0.1',
7781
DOCKER_TAG])
82+
exec_docker(DOCKER_IOTJS_PATH, ['npm', 'install'])
7883

7984
def exec_docker(cwd, cmd, env=[], is_background=False):
8085
exec_cmd = 'cd %s && ' % cwd + ' '.join(cmd)
8186
if is_background:
82-
docker_args = ['exec', '-dit']
87+
docker_args = ['exec', '-d']
8388
else:
84-
docker_args = ['exec', '-it']
89+
docker_args = ['exec', '-t']
8590

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

9398
def start_mosquitto_server():
94-
exec_docker(DOCKER_ROOT_PATH, ['mosquitto', '-d'])
99+
exec_docker(DOCKER_ROOT_PATH, ['mosquitto', '-d'], [], True)
95100

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

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

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

151+
@job('n-api-es2015-subset')
152+
def job_n_api():
153+
start_container()
146154
for buildtype in BUILDTYPES:
147155
build_iotjs(buildtype, [
148156
'--run-test=full',
@@ -220,7 +228,7 @@ def job_tizen():
220228

221229
@job('misc')
222230
def job_misc():
223-
ex.check_run_cmd('tools/check_signed_off.sh', ['--travis'])
231+
# ex.check_run_cmd('tools/check_signed_off.sh', ['--travis'])
224232
ex.check_run_cmd('tools/check_tidy.py')
225233

226234
@job('external-modules')

0 commit comments

Comments
 (0)