-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into ANDROID-13655_button_ids
- Loading branch information
Showing
92 changed files
with
3,704 additions
and
1,286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
name: 'Generate HTML Report' | ||
description: 'Generates HTML report from screenshots' | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: ${GITHUB_ACTION_PATH}/scripts/generate-html-report.sh | ||
shell: bash |
59 changes: 59 additions & 0 deletions
59
.github/actions/generate-html-report/scripts/generate-html-report.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
mkdir reports | ||
touch reports/report.html | ||
cp */screenshots/*_compare.png reports/ | ||
files=$(find . -type f -name "*_compare.png" | grep "reports/") | ||
{ | ||
echo '<!doctype html>' | ||
echo '<html>' | ||
echo '<head>' | ||
echo '<title>Screenshots failure report</title>' | ||
echo '<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" rel="stylesheet">' | ||
echo '<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">' | ||
echo '<meta charset="UTF-8">' | ||
echo '</head>' | ||
echo '<style>' | ||
echo 'body {' | ||
echo 'display: flex;' | ||
echo 'min-height: 100vh;' | ||
echo 'flex-direction: column;' | ||
echo '}' | ||
echo 'main {' | ||
echo 'flex: 1 0 auto;' | ||
echo '}' | ||
echo '</style>' | ||
echo '<body>' | ||
echo '<nav>' | ||
echo '<div class="nav-wrapper indigo darken-3">' | ||
echo '<a href="#" class="brand-logo left">Screenshots failure report</a>' | ||
echo '<ul id="nav-mobile" class="right hide-on-med-and-down">' | ||
echo '<li><a href="https://github.com/takahirom/roborazzi">Roborazzi</a></li>' | ||
echo '</ul>' | ||
echo '</div>' | ||
echo '</nav>' | ||
echo '<main class="container">' | ||
echo '<div class="section">' | ||
echo '<table class="highlight responsive-table">' | ||
echo '<tr><th>File name</th><th>Comparison</th></tr>' | ||
} >> reports/report.html | ||
|
||
for file in $files; do | ||
# Get the file name and insert newlines every 100 characters | ||
fileName=$(basename "$file" | sed -r 's/(.{100})/\1<br>/g') | ||
echo "<tr><td>$(basename "$file")</td>" >> reports/report.html | ||
echo "<td><a href=\"$(basename "$file")\"><img src=\"$(basename "$file")\" width=\"100%\" height=\"100%\" /></a></td></tr>" >> reports/report.html | ||
done | ||
{ | ||
echo '</table>' | ||
echo '</div>' | ||
echo '</main>' | ||
echo '<footer class="page-footer indigo darken-3">' | ||
echo '<div></div>' | ||
echo '</footer>' | ||
echo '<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"></script>' | ||
echo '</body></html>' | ||
} >> reports/report.html | ||
|
||
echo "Report: " | ||
cat reports/report.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Compare Screenshots | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
|
||
jobs: | ||
CompareScreenshots: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2 | ||
|
||
- name: Verify Screenshots (roborazzi) | ||
run: 'bash ./gradlew verifyRoborazziDebug' | ||
|
||
- id: generate-html | ||
name: Generate Html Report | ||
if: failure() | ||
uses: ./.github/actions/generate-html-report | ||
|
||
- name: Generate screenshots tests reports tar.gz | ||
if: failure() | ||
run: | | ||
tar cvzf mistica-screenshots-tests-report.tar.gz reports || echo "No screenshots tests reports found" | ||
shell: bash | ||
|
||
- name: Checkout Telefonica/github-actions repo | ||
if: failure() | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: Telefonica/github-actions | ||
token: "${{ secrets.NOVUM_PRIVATE_REPOS }}" | ||
path: .github/shared-actions | ||
|
||
- name: Upload reports to azure | ||
if: failure() | ||
uses: ./.github/shared-actions/azure/upload-to-storage | ||
with: | ||
azure-account-name: ${{secrets.AZURE_ACCOUNT_NAME}} | ||
azure-account-key: ${{secrets.AZURE_ACCOUNT_KEY}} | ||
globs: | | ||
mistica-screenshots-tests-report.tar.gz | ||
generate-summary: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: "Update screenshot baseline" | ||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
screenshots_baseline: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Roborazzi Record | ||
run: 'bash ./gradlew clean recordRoborazziDebug' | ||
|
||
- name: Check Git status | ||
run: 'git status' | ||
shell: bash | ||
|
||
- name: Commit and push screenshots baseline | ||
id: commitAndPushScreenshotsBaseline | ||
uses: EndBug/add-and-commit@v7 | ||
with: | ||
message: 'Updated screenshots baseline' | ||
add: './**/screenshots/*' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.