|
@@ -6,36 +6,7 @@ const release = _.includes(process.argv, '--release');
|
6
|
6
|
run();
|
7
|
7
|
|
8
|
8
|
function run() {
|
9
|
|
- try {
|
10
|
|
- const conf = release ? `release` : `debug`;
|
11
|
|
- exec.execSync(`detox build --configuration ios.sim.${conf}`);
|
12
|
|
-
|
13
|
|
- startRecording();
|
14
|
|
-
|
15
|
|
- exec.execAsync(`open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app`);
|
16
|
|
-
|
17
|
|
- exec.execSync(`detox test --configuration ios.sim.${conf} ${process.env.CI ? '--cleanup' : ''}`);
|
18
|
|
- } finally {
|
19
|
|
- stopRecording();
|
20
|
|
- }
|
21
|
|
-}
|
22
|
|
-
|
23
|
|
-function startRecording() {
|
24
|
|
- const screenId = exec.execSyncRead(`ffmpeg -f avfoundation -list_devices true -i "" 2>&1 | grep "Capture screen 0" | sed -e "s/.*\\[//" -e "s/\\].*//"`);
|
25
|
|
- exec.execAsync(`ffmpeg -f avfoundation -i "${screenId}:none" out.avi`);
|
26
|
|
-}
|
27
|
|
-
|
28
|
|
-function stopRecording() {
|
29
|
|
- exec.execSync(`ps -ef | grep ffmpeg`);
|
30
|
|
- exec.execSync(`killall ffmpeg || true`);
|
31
|
|
-
|
32
|
|
- exec.execSync(`ls -l out.avi`);
|
33
|
|
- setTimeout(() => {
|
34
|
|
- exec.execSync(`ls -l out.avi`);
|
35
|
|
- const json = require('./../package.json');
|
36
|
|
- json.name = 'fix-travis-rnn';
|
37
|
|
- json.version = `0.0.${Date.now()}`;
|
38
|
|
- require('fs').writeFileSync('./package.json', JSON.stringify(json, null, 2), { encoding: 'utf-8' });
|
39
|
|
- exec.execSync(`npm run release`);
|
40
|
|
- }, 30000);
|
|
9
|
+ const conf = release ? `release` : `debug`;
|
|
10
|
+ exec.execSync(`detox build --configuration ios.sim.${conf}`);
|
|
11
|
+ exec.execSync(`detox test --configuration ios.sim.${conf} ${process.env.CI ? '--cleanup' : ''}`);
|
41
|
12
|
}
|