-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
28 lines (23 loc) · 840 Bytes
/
index.js
File metadata and controls
28 lines (23 loc) · 840 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
const core = require('@actions/core');
const simctl = require('./simctl');
// most @actions toolkit packages have async methods
async function run() {
try {
const platform = core.getInput('platform');
const name = core.getInput('name', { required: true });
const os = core.getInput('os');
const simulator = await core.group('Find suitable simulator', async () => {
const simulator = await simctl.findMatchingSimulator(platform, name, os);
core.info('Found suitable simulator: ' + simulator.destinationString);
return simulator;
});
if (simulator != undefined && simulator.isAvailable && !simulator.isBooted) {
core.info('Booting simulator: ' + simulator.destinationString);
await simctl.boot(simulator);
}
}
catch (error) {
core.setFailed(error.message);
}
}
run()