mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
ci: consolidate verified component preparation
This commit is contained in:
1 parent
d111b2b3dd
commit
d7bf0b274f
31 files changed
+1269
-503
No files matched your search
@@ -31,14 +31,14 @@ class XboxBuildSourceTest(unittest.TestCase):
|
||||
git('switch', '-q', 'main')
|
||||
(root / 'backend').write_text('merged backend')
|
||||
git('commit', '-qam', 'backend changed after branch')
|
||||
for name in ('xbox', 'apk', 'tests'):
|
||||
for name in ('source', 'xbox', 'components', 'apk', 'tests', 'dispatch'):
|
||||
git('clone', '-q', str(root), str(root / name))
|
||||
git('checkout', '-q', head, cwd=root / name)
|
||||
output = root / 'output'
|
||||
env['GITHUB_OUTPUT'] = str(output)
|
||||
subprocess.run(['bash', '-c', step('xbox', 'Pin and merge the APK source')], cwd=root / 'xbox', env=env, check=True, capture_output=True)
|
||||
subprocess.run(['bash', '-c', step('source', 'Pin and merge the APK source')], cwd=root / 'source', env=env, check=True, capture_output=True)
|
||||
base = output.read_text().strip().split('=', 1)[1]
|
||||
tree = git('rev-parse', 'HEAD^{tree}', cwd=root / 'xbox')
|
||||
tree = git('rev-parse', 'HEAD^{tree}', cwd=root / 'source')
|
||||
(root / 'backend').write_text('newer main, after backend build')
|
||||
git('commit', '-qam', 'main advanced again')
|
||||
env.update(BUILD_BASE_SHA=base, XBOX_SOURCE_TREE=tree)
|
||||
@@ -50,3 +50,15 @@ class XboxBuildSourceTest(unittest.TestCase):
|
||||
subprocess.run(['bash', '-c', step('python-tests', 'Merge the pinned APK base')], cwd=root / 'tests', env=env, check=True, capture_output=True)
|
||||
subprocess.run(['bash', '-c', step('python-tests', 'Verify backend and test source match')], cwd=root / 'tests', env=env, check=True, capture_output=True)
|
||||
self.assertEqual(git('rev-parse', 'HEAD^{tree}', cwd=root / 'tests'), tree)
|
||||
|
||||
env['SOURCE_TREE'] = tree
|
||||
for job in ('xbox', 'components'):
|
||||
subprocess.run(['bash', '-c', step(job, 'Merge the pinned APK base')], cwd=root / job, env=env, check=True, capture_output=True)
|
||||
subprocess.run(['bash', '-c', step(job, 'Verify pinned source tree')], cwd=root / job, env=env, check=True, capture_output=True)
|
||||
self.assertEqual(git('rev-parse', 'HEAD^{tree}', cwd=root / job), tree)
|
||||
|
||||
trusted = root / 'trusted-output'
|
||||
env['GITHUB_OUTPUT'] = str(trusted)
|
||||
subprocess.run(['bash', '-c', step('source', 'Resolve trusted manifest base')], cwd=root / 'dispatch', env=env, check=True, capture_output=True)
|
||||
self.assertEqual(trusted.read_text().strip(), 'base-sha=' + git('rev-parse', 'main'))
|
||||
self.assertNotEqual(git('rev-parse', 'HEAD', cwd=root / 'dispatch'), git('rev-parse', 'main'))
|
||||
Reference in new issue
Block a user