reg-viz / reg-suit

:recycle: Visual Regression Testing tool

Home Page:https://reg-viz.github.io/reg-suit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On github actions, always "warn Failed to detect the previous snapshot key"

hirokiynp opened this issue · comments

on local , reg-suit sync-expected is correctly working.
but, reg-suit sync-expected is not working correctly in github actions.

name: CI

on: [push]

jobs:
  build:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v2
    - name: Use Node.js v11
      uses: actions/setup-node@v1
      with:
        node-version: "11.0.0"
    - run: yarn install
    - name: workaround for detached HEAD
      run: |
        git checkout ${GITHUB_REF#refs/heads/} || git checkout -b ${GITHUB_REF#refs/heads/} && git pull
    - name: run reg-suit
      env:
        AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
        AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
      run: |
        yarn run test-visual 

"run test-visual" call "reg-suit run".

on local

[reg-suit] info Detected the previous snapshot key: 'a7c1b4***************************************'

on github actions

[reg-suit] warn Failed to detect the previous snapshot key
[reg-suit] info Skipped to fetch the expected data because expected key is null.

by this problem, I can't compair images....

please help me.

I met same issue and found the cause.

In https://github.com/actions/checkout/tree/v2.1.0#checkout-v2

Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
The actions/checkout@v2 fetch only single SHA and no history.

I confirmed the issue fixed with 2 options. One is set the option fetch-depth: 0. The other is following https://github.com/actions/checkout/tree/v2.1.0#fetch-all-history-for-all-tags-and-branches