CI: make sure Paparazzi test failures stop the test flow (#117)
* Run Paparazzi tests just once when koverMergedReport is used. * Make sure a Paparazzi failure breaks the test flow and blocks merging. * Change ./gradlew check call in quality.yml to custom runQualityChecks task.
This commit is contained in:
parent
d9bbe80392
commit
f300842a87
61 changed files with 143 additions and 57 deletions
48
.github/workflows/tests.yml
vendored
48
.github/workflows/tests.yml
vendored
|
|
@ -1,6 +1,7 @@
|
|||
name: Test
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request: { }
|
||||
push:
|
||||
branches: [ main, develop ]
|
||||
|
|
@ -8,7 +9,7 @@ on:
|
|||
# Enrich gradle.properties for CI/CD
|
||||
env:
|
||||
GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx3072m -Dfile.encoding=UTF-8 -XX:+HeapDumpOnOutOfMemoryError" -Dkotlin.daemon.jvm.options="-Xmx2560m" -Dkotlin.incremental=false
|
||||
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4 --no-daemon
|
||||
CI_GRADLE_ARG_PROPERTIES: --stacktrace -PpreDexEnable=false --max-workers 4
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
|
|
@ -20,11 +21,42 @@ jobs:
|
|||
group: ${{ github.ref == 'refs/heads/main' && format('unit-tests-main-{0}', github.sha) || github.ref == 'refs/heads/develop' && format('unit-tests-develop-{0}', github.sha) || format('unit-tests-{0}', github.ref) }}
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Run tests and generate kover report
|
||||
run: ./gradlew koverMergedReport $CI_GRADLE_ARG_PROPERTIES
|
||||
- name: ⏬ Checkout with LFS
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
lfs: 'true'
|
||||
|
||||
- name: Archive kover report
|
||||
- name: ⚙️ Run unit & screenshot tests, generate kover report
|
||||
run: ./gradlew koverMergedReport $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
|
||||
|
||||
- name: 📈 Verify coverage
|
||||
run: ./gradlew koverMergedVerify $CI_GRADLE_ARG_PROPERTIES -Pci-build=true
|
||||
|
||||
- name: 🚫 Upload kover failed coverage reports
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: kover-error-report
|
||||
path: |
|
||||
**/kover/merged/verification/errors.txt
|
||||
|
||||
- name: 📸 Upload Screenshot test report
|
||||
uses: actions/upload-artifact@v3
|
||||
if: always()
|
||||
with:
|
||||
name: reports
|
||||
path: tests/uitests/build/reports/tests/testDebugUnitTest/
|
||||
retention-days: 5
|
||||
|
||||
- name: 🚫 Upload Screenshot failure differences on error
|
||||
uses: actions/upload-artifact@v3
|
||||
if: failure()
|
||||
with:
|
||||
name: failures
|
||||
path: tests/uitests/out/failures/
|
||||
retention-days: 5
|
||||
|
||||
- name: ✅ Upload kover report
|
||||
if: always()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
@ -32,7 +64,7 @@ jobs:
|
|||
path: |
|
||||
**/build/reports/kover/merged
|
||||
|
||||
- name: Archive test results on error
|
||||
- name: 🚫 Upload test results on error
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
|
|
@ -41,7 +73,7 @@ jobs:
|
|||
**/out/failures/
|
||||
**/build/reports/tests/*UnitTest/
|
||||
|
||||
- name: Publish results to Sonar
|
||||
- name: 🔊 Publish results to Sonar
|
||||
env:
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
ORG_GRADLE_PROJECT_SONAR_LOGIN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
|
@ -49,7 +81,7 @@ jobs:
|
|||
run: ./gradlew sonar $CI_GRADLE_ARG_PROPERTIES
|
||||
|
||||
# https://github.com/codecov/codecov-action
|
||||
- name: Upload coverage reports to codecov
|
||||
- name: ☂️ Upload coverage reports to codecov
|
||||
if: always()
|
||||
uses: codecov/codecov-action@v3
|
||||
# with:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue