mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 08:01:56 +00:00
* ci: share mobile route analysis and scope mobile test runs * ci: cover mobile web runner process dependencies * test: verify mobile web selectors through the new runner --------- Co-authored-by: m4air <m4air@m4airs-Air.localdomain>
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import { appendFileSync, readFileSync } from 'node:fs'
|
|
import { pathToFileURL } from 'node:url'
|
|
import { isDocsOnlyPath } from './pr-code-change-scope.mjs'
|
|
|
|
const NON_TEST_FILES = new Set([
|
|
'mobile/Gemfile',
|
|
'mobile/Gemfile.lock',
|
|
'mobile/README.md',
|
|
'.github/workflows/mobile-ios-release.yml',
|
|
'config/scripts/pr-code-change-scope.mjs',
|
|
'config/scripts/pr-code-change-scope.test.mjs',
|
|
'config/scripts/mobile-release-check-scope.mjs',
|
|
'config/scripts/mobile-release-check-scope.test.mjs'
|
|
])
|
|
|
|
export function shouldRunMobileTests(files) {
|
|
return (
|
|
files.length === 0 ||
|
|
files.some(
|
|
(file) =>
|
|
file.split('/').includes('..') ||
|
|
(!isDocsOnlyPath(file) &&
|
|
!NON_TEST_FILES.has(file) &&
|
|
!file.startsWith('mobile/docs/') &&
|
|
!file.startsWith('mobile/fastlane/'))
|
|
)
|
|
)
|
|
}
|
|
|
|
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
|
|
const input = readFileSync(process.argv[2], 'utf8')
|
|
const files = input.endsWith('\0') ? input.slice(0, -1).split('\0') : []
|
|
appendFileSync(process.env.GITHUB_OUTPUT, `should_run=${shouldRunMobileTests(files)}\n`)
|
|
}
|