Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Regression TestをCIで実行するのハンズオンを追加 #4

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/upload_expected_image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v1
uses: gradle/wrapper-validation-action@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
Expand All @@ -42,5 +42,5 @@ jobs:
# Upload screenshots to GitHub Actions Artifacts
- uses: actions/upload-artifact@v4
with:
name: screenshots
name: expected_screenshots
path: screenshots/*
41 changes: 41 additions & 0 deletions .github/workflows/visual_regression.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Visual Regression

on: pull_request

concurrency:
group: build-${{ github.ref }}
cancel-in-progress: true

jobs:
visual-regression:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Validate Gradle Wrapper
uses: gradle/wrapper-validation-action@v2

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Setup Android SDK
uses: android-actions/setup-android@v3

# 期待値画像をbaseブランチのArtifactからダウンロードする


# 現在のブランチでスクリーンショット画像を取得する


# reg-suitのインストールと実行


# 結果をArtifactsにアップロード
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,5 @@ captures/

# node.js
/node_modules/

screenshots/
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -167,4 +167,4 @@ configurations.configureEach {

roborazzi {
outputDir.set(rootProject.file("screenshots"))
}
}
2 changes: 1 addition & 1 deletion docs/handson/UILayerTest.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ UIテストには、コード変更前後の画面スクリーンショットを
- [ComposeのNavigationをテストする](./UIElementTest_Navigation.md)
- Jetpack Composeの画面スクリーンショットを使ってVisual Regression Testを実現する
- [Composeのプレビュー画面でVisual Regression Testを行う](./VisualRegressionTest_Preview.md)
- Visual Regression TestをCIで運用する
- [Visual Regression TestをCIで実行する](./VisualRegressionTest_CI.md)
- プレビューでは確認できないComposeの画面のスクリーンショットを撮る
400 changes: 400 additions & 0 deletions docs/handson/VisualRegressionTest_CI.md

Large diffs are not rendered by default.

Binary file added docs/handson/images/reg-out.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/handson/images/vrt-result-pr-comments.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/handson/images/workflow.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.