Skip to content

Commit e1ab0c4

Browse files
committed
Upgrade dependencies
1 parent c4f8bc4 commit e1ab0c4

26 files changed

Lines changed: 30492 additions & 38386 deletions

‎.github/workflows/test.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v7
1414
- run: |
15-
npm install
15+
npm ci
1616
- run: |
1717
npm run all
1818
test: # make sure the action works on a clean machine without building

‎.github/workflows/update-overlays.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- run: rm -rf tmp
5353

5454
- name: "Check for changes and create/update PR"
55-
uses: peter-evans/create-pull-request@v3
55+
uses: peter-evans/create-pull-request@v8
5656
with:
5757
token: "${{ secrets.FASTLANE_UPDATE_GITHUB_TOKEN }}"
5858
commit-message: "[auto] update overlays"

‎.gitignore‎

Lines changed: 8 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -1,103 +1,18 @@
1-
# Dependency directory
2-
node_modules
3-
4-
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
5-
# Logs
6-
logs
1+
node_modules/
2+
lib/
3+
coverage/
4+
*.lcov
75
*.log
86
npm-debug.log*
9-
yarn-debug.log*
10-
yarn-error.log*
11-
lerna-debug.log*
12-
13-
# Diagnostic reports (https://nodejs.org/api/report.html)
14-
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
15-
16-
# Runtime data
17-
pids
18-
*.pid
19-
*.seed
20-
*.pid.lock
21-
22-
# Directory for instrumented libs generated by jscoverage/JSCover
23-
lib-cov
24-
25-
# Coverage directory used by tools like istanbul
26-
coverage
27-
*.lcov
28-
29-
# nyc test coverage
30-
.nyc_output
31-
32-
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
33-
.grunt
34-
35-
# Bower dependency directory (https://bower.io/)
36-
bower_components
37-
38-
# node-waf configuration
39-
.lock-wscript
40-
41-
# Compiled binary addons (https://nodejs.org/api/addons.html)
42-
build/Release
43-
44-
# Dependency directories
45-
jspm_packages/
46-
47-
# TypeScript v1 declaration files
48-
typings/
49-
50-
# TypeScript cache
517
*.tsbuildinfo
52-
53-
# Optional npm cache directory
54-
.npm
55-
56-
# Optional eslint cache
8+
.npm/
579
.eslintcache
58-
59-
# Optional REPL history
60-
.node_repl_history
61-
62-
# Output of 'npm pack'
6310
*.tgz
64-
65-
# Yarn Integrity file
66-
.yarn-integrity
67-
68-
# dotenv environment variables file
6911
.env
70-
.env.test
71-
72-
# parcel-bundler cache (https://parceljs.org/)
73-
.cache
74-
75-
# next.js build output
76-
.next
77-
78-
# nuxt.js build output
79-
.nuxt
80-
81-
# vuepress build output
82-
.vuepress/dist
83-
84-
# Serverless directories
85-
.serverless/
86-
87-
# FuseBox cache
88-
.fusebox/
89-
90-
# DynamoDB Local files
91-
.dynamodb/
92-
93-
# OS metadata
12+
.env.*
9413
.DS_Store
9514
Thumbs.db
9615

97-
# Ignore built ts files
98-
__tests__/runner/*
99-
lib/**/*
100-
101-
# .envrc
102-
.direnv
16+
# direnv & nix
17+
.direnv/
10318
.pre-commit-config.yaml

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
behavior) to optionally wait, after boot, for the Simulator's background
55
daemon-spawning CPU burst to subside before continuing.
66
- Bump NodeJS to 24.
7+
- Upgrade to native ES modules and modernized toolchain (TypeScript 6, @actions/core 3, Vitest 5, ESLint 10, @vercel/ncc 0.45, Nix flake inputs).
78

89
## v5
910

‎README.md‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ steps:
1313
- uses: actions/checkout@v5
1414
- uses: futureware-tech/simulator-action@v5
1515
with:
16-
model: 'iPhone 8'
16+
model: 'iPhone 16'
1717
- run: flutter drive
1818
```
1919
@@ -30,25 +30,25 @@ For GitHub Actions runners, a fresh list of devices is maintained in the
3030
project. Note that UDID and OS version can be rather volatile and may change
3131
when Mac OS updates, so it's recommended to stay with only specifying the model
3232
or if you really need OS version, leave it on the loose side (e.g.
33-
`os_version: ">=14.0"`). The UDIDs on that page also cannot be used to register
33+
`os_version: ">=18.0"`). The UDIDs on that page also cannot be used to register
3434
a device with Apple Developer account, because a Simulator UDID
3535
[can not be used there](https://developer.apple.com/forums/thread/693026).
3636

37-
| Name | Sample values | Description |
38-
| ---------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
39-
| `model` | `iPhone 8` | Model of the device you'd like to launch |
40-
| `os` | `iOS`, `tvOS`, `watchOS` | OS type of the device |
41-
| `os_version` | `>=14.0` | OS version specification in semver format |
42-
| `udid` | `ABCD-EFGH` | Specific UDID you'd like to launch |
43-
| `erase_before_boot` | `true` | Whether the data should be erased from device before boot. Starting from a clean state helps getting a stable environment for tests |
44-
| `wait_for_boot` | `false` | Whether the action must wait for the Simulator to finish booting requested image |
45-
| `boot_timeout_seconds` | `360` | Maximum number of seconds to wait for the Simulator to finish booting (0 disables the timeout) |
46-
| `boot_retries` | `2` | Number of times to retry booting when waiting for the Simulator to finish booting fails. Setting this to 2 will result in 3 attempts: one normal attempt and two retries. |
47-
| `settle_timeout_seconds` | `(unset)` | Maximum number of seconds to wait, after boot, for the Simulator's background CPU usage (daemons spawned by launchd_sim) to settle down before continuing. Leave unset (default) or set to 0 to skip this check entirely, preserving prior behavior -- nothing is logged either way. When set to a positive value, if the Simulator hasn't settled within that time, a warning is logged and the action continues without failing the job. |
48-
| `settle_check_interval_seconds` | `2` | Number of seconds between checks of the Simulator's background CPU usage. Only relevant when `settle_timeout_seconds` is set to a positive value. |
49-
| `settle_cpu_threshold_percent` | `20` | Aggregate %CPU (summed across all direct children of launchd_sim) below which the Simulator is considered settled. Only relevant when `settle_timeout_seconds` is set to a positive value. |
50-
| `settle_consecutive_samples` | `3` | Number of consecutive checks below `settle_cpu_threshold_percent` required before the Simulator is considered settled. Only relevant when `settle_timeout_seconds` is set to a positive value. |
51-
| `shutdown_after_job` | `true` | Whether to shutdown the launched Simulator after the workflow job has been finished |
37+
| Name | Sample values | Description |
38+
| ------------------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
39+
| `model` | `iPhone 16` | Model of the device you'd like to launch |
40+
| `os` | `iOS`, `tvOS`, `watchOS` | OS type of the device |
41+
| `os_version` | `>=18.0` | OS version specification in semver format |
42+
| `udid` | `ABCD-EFGH` | Specific UDID you'd like to launch |
43+
| `erase_before_boot` | `true` | Whether the data should be erased from device before boot. Starting from a clean state helps getting a stable environment for tests |
44+
| `wait_for_boot` | `false` | Whether the action must wait for the Simulator to finish booting requested image |
45+
| `boot_timeout_seconds` | `360` | Maximum number of seconds to wait for the Simulator to finish booting (0 disables the timeout) |
46+
| `boot_retries` | `2` | Number of times to retry booting when waiting for the Simulator to finish booting fails. Setting this to 2 will result in 3 attempts: one normal attempt and two retries. |
47+
| `settle_timeout_seconds` | `(unset)` | Maximum number of seconds to wait, after boot, for the Simulator's background CPU usage (daemons spawned by launchd_sim) to settle down before continuing. Leave unset (default) or set to 0 to skip this check entirely, preserving prior behavior -- nothing is logged either way. When set to a positive value, if the Simulator hasn't settled within that time, a warning is logged and the action continues without failing the job. |
48+
| `settle_check_interval_seconds` | `2` | Number of seconds between checks of the Simulator's background CPU usage. Only relevant when `settle_timeout_seconds` is set to a positive value. |
49+
| `settle_cpu_threshold_percent` | `20` | Aggregate %CPU (summed across all direct children of launchd_sim) below which the Simulator is considered settled. Only relevant when `settle_timeout_seconds` is set to a positive value. |
50+
| `settle_consecutive_samples` | `3` | Number of consecutive checks below `settle_cpu_threshold_percent` required before the Simulator is considered settled. Only relevant when `settle_timeout_seconds` is set to a positive value. |
51+
| `shutdown_after_job` | `true` | Whether to shutdown the launched Simulator after the workflow job has been finished |
5252

5353
## Outputs
5454

‎__tests__/main.test.ts‎

Lines changed: 56 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import * as cp from 'child_process'
2-
import * as path from 'path'
3-
import * as process from 'process'
1+
import * as cp from 'node:child_process'
2+
import * as path from 'node:path'
3+
import * as process from 'node:process'
4+
import {expect, test} from 'vitest'
45

56
// The available iOS device lineup shifts as the CI runner's Xcode version
67
// changes, so a hardcoded model (e.g. a fixed "iPhone 16") can disappear.
@@ -29,39 +30,60 @@ function findAnyAvailableIOSModel(): string {
2930
)
3031
}
3132

32-
test('boots a device', () => {
33-
process.env['INPUT_OS_VERSION'] = '>=10.0'
34-
const nodeProcess = process.execPath
35-
const actionMain = path.join(__dirname, '..', 'lib', 'main.js')
36-
const options: cp.ExecFileSyncOptions = {
37-
env: process.env
38-
}
33+
test.runIf(process.platform === 'darwin')(
34+
'boots a device',
35+
() => {
36+
try {
37+
process.env['INPUT_OS_VERSION'] = '>=17.0'
38+
const nodeProcess = process.execPath
39+
const actionMain = path.join(
40+
import.meta.dirname,
41+
'..',
42+
'dist',
43+
'index.js'
44+
)
45+
const options: cp.ExecFileSyncOptions = {
46+
env: process.env
47+
}
3948

40-
const firstRunOutput = cp
41-
.execFileSync(nodeProcess, [actionMain], options)
42-
.toString()
43-
expect(firstRunOutput).toContain('Booting device')
44-
expect(firstRunOutput).not.toContain('Waiting for the Simulator to settle')
49+
const firstRunOutput = cp
50+
.execFileSync(nodeProcess, [actionMain], options)
51+
.toString()
52+
expect(firstRunOutput).toContain('Booting device')
53+
expect(firstRunOutput).not.toContain(
54+
'Waiting for the Simulator to settle'
55+
)
4556

46-
// lower-cased on purpose: also exercises the case-insensitive model match
47-
process.env['INPUT_MODEL'] = findAnyAvailableIOSModel().toLowerCase()
48-
expect(
49-
cp.execFileSync(nodeProcess, [actionMain], options).toString()
50-
).toContain('Booting device')
57+
// lower-cased on purpose: also exercises the case-insensitive model match
58+
process.env['INPUT_MODEL'] = findAnyAvailableIOSModel().toLowerCase()
59+
expect(
60+
cp.execFileSync(nodeProcess, [actionMain], options).toString()
61+
).toContain('Booting device')
5162

52-
process.env['INPUT_WAIT_FOR_BOOT'] = 'true'
53-
expect(
54-
cp.execFileSync(nodeProcess, [actionMain], options).toString()
55-
).toContain('Waiting for device to finish booting')
63+
process.env['INPUT_WAIT_FOR_BOOT'] = 'true'
64+
expect(
65+
cp.execFileSync(nodeProcess, [actionMain], options).toString()
66+
).toContain('Waiting for device to finish booting')
5667

57-
process.env['INPUT_SETTLE_TIMEOUT_SECONDS'] = '5'
58-
process.env['INPUT_SETTLE_CHECK_INTERVAL_SECONDS'] = '1'
59-
expect(
60-
cp.execFileSync(nodeProcess, [actionMain], options).toString()
61-
).toContain('Waiting for the Simulator to settle')
62-
delete process.env['INPUT_SETTLE_TIMEOUT_SECONDS']
63-
delete process.env['INPUT_SETTLE_CHECK_INTERVAL_SECONDS']
68+
process.env['INPUT_SETTLE_TIMEOUT_SECONDS'] = '5'
69+
process.env['INPUT_SETTLE_CHECK_INTERVAL_SECONDS'] = '1'
70+
expect(
71+
cp.execFileSync(nodeProcess, [actionMain], options).toString()
72+
).toContain('Waiting for the Simulator to settle')
73+
delete process.env['INPUT_SETTLE_TIMEOUT_SECONDS']
74+
delete process.env['INPUT_SETTLE_CHECK_INTERVAL_SECONDS']
6475

65-
process.env['INPUT_MODEL'] = 'Pixel 4'
66-
expect(() => cp.execFileSync(nodeProcess, [actionMain], options)).toThrow()
67-
})
76+
process.env['INPUT_MODEL'] = 'Pixel 4'
77+
expect(() =>
78+
cp.execFileSync(nodeProcess, [actionMain], options)
79+
).toThrow()
80+
} finally {
81+
delete process.env['INPUT_OS_VERSION']
82+
delete process.env['INPUT_MODEL']
83+
delete process.env['INPUT_WAIT_FOR_BOOT']
84+
delete process.env['INPUT_SETTLE_TIMEOUT_SECONDS']
85+
delete process.env['INPUT_SETTLE_CHECK_INTERVAL_SECONDS']
86+
}
87+
},
88+
600_000
89+
)

‎__tests__/settle.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import {computeSettleCpu} from '../src/settle'
1+
import {expect, test} from 'vitest'
2+
import {computeSettleCpu} from '../src/settle.js'
23

34
const UDID = 'AAAAAAAA-BBBB-CCCC-DDDD-EEEEEEEEEEEE'
45

‎action.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ branding:
55
color: gray-dark
66
inputs:
77
model:
8-
description: "Simulator device model name (e.g. 'iPhone 8' )"
8+
description: "Simulator device model name (e.g. 'iPhone 16')"
99
required: false
1010
os:
1111
description: "OS type (supported: 'iOS', 'watchOS' and 'tvOS')"
1212
required: false
1313
os_version:
14-
description: "OS version requirement in semver format (e.g. '^14.4')"
14+
description: "OS version requirement in semver format (e.g. '^18.0')"
1515
required: false
1616
udid:
1717
description: >

0 commit comments

Comments
 (0)