From 827f652ca5d0e25cc4df2a1b1dddccef527cd1af Mon Sep 17 00:00:00 2001 From: takumi-saito Date: Thu, 8 Feb 2024 02:31:09 +0900 Subject: [PATCH] add reg-suit actions sample --- .github/workflows/reg.yml | 12 ++++++++--- .github/workflows/reg2.yml | 41 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/reg2.yml diff --git a/.github/workflows/reg.yml b/.github/workflows/reg.yml index f563ad37..9afbf11b 100644 --- a/.github/workflows/reg.yml +++ b/.github/workflows/reg.yml @@ -1,6 +1,11 @@ name: Visual Regression Testing -on: [push] +## プルリクエストのスクリーンショットを保存するワークフロー +on: + push: + branches: + - main + pull_request: jobs: reg-screenshot-test: @@ -8,8 +13,9 @@ jobs: timeout-minutes: 20 permissions: - contents: read # for clone - actions: write # for upload-artifact + actions: read # for downloading artifacts + contents: write # for pushing screenshot-diff to companion branch + pull-requests: write # for creating a comment on pull requests steps: - name: Checkout diff --git a/.github/workflows/reg2.yml b/.github/workflows/reg2.yml new file mode 100644 index 00000000..d70d96b5 --- /dev/null +++ b/.github/workflows/reg2.yml @@ -0,0 +1,41 @@ +# .github/workflows/reg.yml + +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + permissions: + actions: read # for downloading artifacts + contents: write # for pushing screenshot-diff to companion branch + pull-requests: write # for creating a comment on pull requests + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up JDK 17 + uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0 + with: + distribution: temurin + java-version: 17 + - name: Use Node.js v10 + uses: actions/setup-node@v1 + with: + node-version: "10.x" + - name: npm install, build, and test + run: | + npm i + # Better than caching and/or extensions of actions/setup-java + - name: Setup Gradle + uses: gradle/gradle-build-action@87a9a15658c426a54dd469d4fc7dc1a73ca9d4a6 # v2.10.0 + with: + gradle-version: wrapper + - name: workaround for detached HEAD + run: | + git checkout ${GITHUB_REF#refs/heads/} || git checkout -b ${GITHUB_REF#refs/heads/} && git pull + - name: create the current snapshot + run: | + ./gradlew recordRoborazziDebug --stacktrace + - name: run reg-suit + run: | + npx reg-suit run \ No newline at end of file