From a634968f395ad760ec4f3d1ab40bde0b5e47d6c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=B3bert=20Papp?= Date: Sat, 27 Jan 2024 13:29:25 +0000 Subject: [PATCH] Update GitHub Actions major versions (#369) --- .github/workflows/CI-build.yml | 14 +++---- .github/workflows/CI-icons.yml | 6 +-- .github/workflows/CI-instrumentation.yml | 1 + .github/workflows/svg-instrumentation.yml | 5 ++- .github/workflows/svg-report.yml | 45 ++++++++++++----------- .github/workflows/svg.yml | 3 ++ build.gradle | 17 +++++++++ tools/image_compare/README.md | 7 ++-- tools/image_compare/package.json | 4 +- 9 files changed, 63 insertions(+), 39 deletions(-) diff --git a/.github/workflows/CI-build.yml b/.github/workflows/CI-build.yml index fc979b96c..67b5bfbb0 100644 --- a/.github/workflows/CI-build.yml +++ b/.github/workflows/CI-build.yml @@ -19,7 +19,7 @@ jobs: steps: - name: "Set up JDK 17." - uses: actions/setup-java@v3 + uses: actions/setup-java@v4 with: java-version: 17 distribution: zulu @@ -32,7 +32,7 @@ jobs: log-accepted-android-sdk-licenses: false - name: "Checkout ${{ github.ref }} branch in ${{ github.repository }} repository." - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: submodules: true @@ -60,7 +60,7 @@ jobs: - name: "Upload 'Lint Results' artifact." if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'Lint Results' path: | @@ -81,21 +81,21 @@ jobs: - name: "Upload 'Detekt Results' artifact." if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'Detekt Results' path: | ${{ github.workspace }}/**/build/reports/detekt/detekt.* - name: "Publish 'Code scanning results / detekt' GitHub Code Scanning analysis." - uses: github/codeql-action/upload-sarif@v2 + uses: github/codeql-action/upload-sarif@v3 if: success() || failure() with: sarif_file: ${{ github.workspace }}/gradle/plugins-inventory/build/reports/detekt/detekt.sarif - name: "Upload 'Unit Test Results' artifact." if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'Unit Test Results' path: ${{ github.workspace }}/**/build/reports/tests/*/ @@ -112,7 +112,7 @@ jobs: - name: "Upload 'APKs' artifact." if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'APKs' path: | diff --git a/.github/workflows/CI-icons.yml b/.github/workflows/CI-icons.yml index a29e3e07f..44c5cfbdf 100644 --- a/.github/workflows/CI-icons.yml +++ b/.github/workflows/CI-icons.yml @@ -17,7 +17,7 @@ jobs: steps: - name: "Checkout ${{ github.ref }} branch in ${{ github.repository }} repository." - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "Generate icon previews." working-directory: android/data/src/main/res/raw @@ -25,7 +25,7 @@ jobs: - name: "Upload 'Icon Previews' artifact." if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'Icon Previews' path: | @@ -45,7 +45,7 @@ jobs: steps: - name: "Checkout ${{ github.ref }} branch in ${{ github.repository }} repository." - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Register problem matchers. run: echo "::add-matcher::.github/problemMatchers-icons.json" diff --git a/.github/workflows/CI-instrumentation.yml b/.github/workflows/CI-instrumentation.yml index 2e2208039..67bbf048d 100644 --- a/.github/workflows/CI-instrumentation.yml +++ b/.github/workflows/CI-instrumentation.yml @@ -33,6 +33,7 @@ jobs: ./gradlew --no-daemon --stacktrace :android:connectedCheck -Pandroid.testInstrumentationRunnerArguments.notAnnotation=net.twisterrob.android.test.SkipOnCI ./gradlew --no-daemon --stacktrace :android:data:svg:connectedCheck + ./gradlew --no-daemon --stacktrace :mergeAndroidReports strategy: fail-fast: false diff --git a/.github/workflows/svg-instrumentation.yml b/.github/workflows/svg-instrumentation.yml index ce12d6999..c11d095ff 100644 --- a/.github/workflows/svg-instrumentation.yml +++ b/.github/workflows/svg-instrumentation.yml @@ -15,7 +15,7 @@ jobs: name-check-results: '🔔 Test: SVG Results {0}' script: | ./.github/workflows/scripts/adb-shell-create-sdcard-android-dir.sh ${{ matrix.api }} - ./gradlew --no-daemon --stacktrace :android:data:svg:connectedCheck -Pandroid.testInstrumentationRunnerArguments.class=net.twisterrob.inventory.android.data.svg.DumpImages + ./gradlew --no-daemon --stacktrace :android:data:svg:connectedCheck -Pandroid.testInstrumentationRunnerArguments.class=net.twisterrob.inventory.android.data.svg.DumpImages :mergeAndroidReports strategy: fail-fast: false @@ -30,7 +30,8 @@ jobs: - 26 - 27 - 28 - - 29 + # TODO re-enable once https://github.com/ReactiveCircus/android-emulator-runner/issues/373 is resolved. + #- 29 - 30 - 31 - 32 diff --git a/.github/workflows/svg-report.yml b/.github/workflows/svg-report.yml index 354a4dc18..f007d1d7d 100644 --- a/.github/workflows/svg-report.yml +++ b/.github/workflows/svg-report.yml @@ -12,102 +12,103 @@ jobs: steps: - name: "Checkout ${{ github.ref }} branch in ${{ github.repository }} repository." - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: "Download 'SVG 21' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 21' path: 'downloads/SVG 21' - name: "Download 'SVG 22' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 22' path: 'downloads/SVG 22' - name: "Download 'SVG 23' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 23' path: 'downloads/SVG 23' - name: "Download 'SVG 24' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 24' path: 'downloads/SVG 24' - name: "Download 'SVG 25' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 25' path: 'downloads/SVG 25' - name: "Download 'SVG 26' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 26' path: 'downloads/SVG 26' - name: "Download 'SVG 27' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 27' path: 'downloads/SVG 27' - name: "Download 'SVG 28' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 28' path: 'downloads/SVG 28' - - name: "Download 'SVG 29' artifact." - if: success() || failure() - uses: actions/download-artifact@v3 - with: - name: 'SVG 29' - path: 'downloads/SVG 29' + # TODO re-enable once https://github.com/ReactiveCircus/android-emulator-runner/issues/373 is resolved. + #- name: "Download 'SVG 29' artifact." + # if: success() || failure() + # uses: actions/download-artifact@v4 + # with: + # name: 'SVG 29' + # path: 'downloads/SVG 29' - name: "Download 'SVG 30' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 30' path: 'downloads/SVG 30' - name: "Download 'SVG 31' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 31' path: 'downloads/SVG 31' - name: "Download 'SVG 32' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 32' path: 'downloads/SVG 32' - name: "Download 'SVG 33' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 33' path: 'downloads/SVG 33' - name: "Download 'SVG 34' artifact." if: success() || failure() - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: 'SVG 34' path: 'downloads/SVG 34' @@ -135,7 +136,7 @@ jobs: run: | # Get all ZIPs into a folder. # Glob resolution is done by shell, so can't use quotes, have to escape spaces and parentheses. - cp ${{github.workspace}}/downloads/SVG\ ??/android/data/svg/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/test\(AVD\)\ -\ */svg_??.zip ./ + cp ${{github.workspace}}/downloads/SVG\ ??/android/data/svg/build/outputs/connected_android_test_additional_output/debugAndroidTest/connected/emulator-5554\ -\ */svg_??.zip ./ # At this point we should have svg_??.zip files. # Unzip all ZIPs into separate folders. @@ -144,7 +145,7 @@ jobs: - name: "Upload 'SVG Report' artifact." if: success() || failure() - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'SVG Report' path: | diff --git a/.github/workflows/svg.yml b/.github/workflows/svg.yml index f49e0ad73..46e686040 100644 --- a/.github/workflows/svg.yml +++ b/.github/workflows/svg.yml @@ -8,6 +8,9 @@ on: - 'android/data/svg/**' branches: - main + pull_request: + paths: + - '.github/workflows/svg*.yml' jobs: diff --git a/build.gradle b/build.gradle index d18828968..355e7d50f 100644 --- a/build.gradle +++ b/build.gradle @@ -20,3 +20,20 @@ idea { ] } } + +// TODEL https://issuetracker.google.com/issues/222730176 +// This makes sure to pick up all subprojects not just direct children. +// com.android.build.gradle.internal.plugins.ReportingPlugin reads the subprojects in afterEvaluate, +// so this will run at the right time for it to observe evaluated children. +subprojects.forEach { evaluationDependsOn(it.path) } // evaluationDependsOnSubprojects() +// https://developer.android.com/studio/test/command-line#multi-module-reports-instrumented-tests +apply(plugin: "android-reporting") +afterEvaluate { + tasks.named("mergeAndroidReports").configure { + mustRunAfter(dependsOn) + setDependsOn([ ]) + doFirst { + resultsDirectories.removeIf { !it.exists() } + } + } +} diff --git a/tools/image_compare/README.md b/tools/image_compare/README.md index 30555475c..84520e9d7 100644 --- a/tools/image_compare/README.md +++ b/tools/image_compare/README.md @@ -14,16 +14,17 @@ For example: * image2.png To compare the above structure, run this command: -``` +```shell node image_compare compare_foo_bar/foo compare_foo_bar/bar compare_foo_bar/diff ``` and investigate the results in `compare_foo_bar/diff`. ## Setup -``` +```shell npm install ``` ## Usage -SVN ignored all `compare_*` files and folders. +GIT ignores all `compare_*` files and folders, +so it's recommended to start by setting up a diff root that way. diff --git a/tools/image_compare/package.json b/tools/image_compare/package.json index db6dfeebd..4448989b9 100644 --- a/tools/image_compare/package.json +++ b/tools/image_compare/package.json @@ -16,7 +16,7 @@ "node": ">=10.0.0" }, "dependencies": { - "pixelmatch": "^5.1.0", - "pngjs": "^3.4.0" + "pixelmatch": "^5.3.0", + "pngjs": "^7.0.0" } }