mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 12:56:06 +00:00
ci: fail the checks gate when store engine tests fail (#2844)
* ci: fail the checks gate when store engine tests fail * test(ci): expect store-tests in the checks gate --------- Co-authored-by: Tapuuk <177422350+Tapuuk@users.noreply.github.com>
This commit is contained in:
1 parent
19fa6fd8e2
commit
fd2f1eec8a
2 files changed
+8
-9
No files matched your search
@@ -765,7 +765,6 @@ jobs:
|
||||
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
continue-on-error: true
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
@@ -811,7 +810,6 @@ jobs:
|
||||
stores-host-v1-${{ runner.os }}-${{ runner.arch }}-${{ steps.rust.outputs.rustc }}-
|
||||
- name: Store engines host unit tests
|
||||
timeout-minutes: 10
|
||||
continue-on-error: true
|
||||
run: |
|
||||
set -o pipefail
|
||||
cd app/src/main/rust/stores
|
||||
@@ -900,7 +898,7 @@ jobs:
|
||||
|
||||
checks:
|
||||
name: Compile and test APK
|
||||
needs: [build, python-tests]
|
||||
needs: [build, python-tests, store-tests]
|
||||
if: ${{ !cancelled() && (github.event_name != 'pull_request' || !github.event.pull_request.draft) }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
@@ -909,7 +907,8 @@ jobs:
|
||||
env:
|
||||
BUILD_RESULT: ${{ needs.build.result }}
|
||||
PYTHON_RESULT: ${{ needs.python-tests.result }}
|
||||
run: test "$BUILD_RESULT" = success && test "$PYTHON_RESULT" = success
|
||||
STORE_RESULT: ${{ needs.store-tests.result }}
|
||||
run: test "$BUILD_RESULT" = success && test "$PYTHON_RESULT" = success && test "$STORE_RESULT" = success
|
||||
|
||||
sign:
|
||||
needs: [build, checks]
|
||||
|
||||
@@ -115,15 +115,15 @@ class CiChecksTest(unittest.TestCase):
|
||||
jobs = yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())['jobs']
|
||||
gate = jobs['checks']
|
||||
self.assertEqual(gate['name'], 'Compile and test APK')
|
||||
self.assertEqual(set(gate['needs']), {'build', 'python-tests'})
|
||||
self.assertEqual(set(gate['needs']), {'build', 'python-tests', 'store-tests'})
|
||||
self.assertIn('!cancelled()', gate['if'])
|
||||
for build, python in itertools.product(('success', 'failure', 'cancelled', 'skipped'), repeat=2):
|
||||
with self.subTest(build=build, python=python):
|
||||
for build, python, store in itertools.product(('success', 'failure', 'cancelled', 'skipped'), repeat=3):
|
||||
with self.subTest(build=build, python=python, store=store):
|
||||
result = subprocess.run(
|
||||
['bash', '-c', gate['steps'][0]['run']],
|
||||
env=dict(os.environ, BUILD_RESULT=build, PYTHON_RESULT=python),
|
||||
env=dict(os.environ, BUILD_RESULT=build, PYTHON_RESULT=python, STORE_RESULT=store),
|
||||
capture_output=True)
|
||||
self.assertEqual(result.returncode == 0, build == python == 'success')
|
||||
self.assertEqual(result.returncode == 0, build == python == store == 'success')
|
||||
for publisher in ('sign', 'packs'):
|
||||
self.assertIn('checks', jobs[publisher]['needs'])
|
||||
|
||||
Reference in new issue
Block a user