diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3bc091e..5fd4d80 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,5 +1,12 @@ name: Test -on: push +on: + push: + workflow_dispatch: + inputs: + branch: + required: false + type: string + default: master jobs: test: name: Test @@ -22,4 +29,18 @@ jobs: key: v1/${{ runner.os }}/node-${{ matrix.node }}/${{ hashFiles('**/yarn.lock') }} restore-keys: v1/${{ runner.os }}/node-${{ matrix.node }}/ - run: yarn + - name: Set up @percy/cli from git + if: ${{ github.event_name == 'workflow_dispatch' }} + run: | + cd /tmp + git clone --branch ${{ github.event.inputs.branch }} --depth 1 https://github.com/percy/cli + cd cli + PERCY_PACKAGES=`find packages -type d -depth 1 | sed -e 's/packages/@percy/g' | tr '\n' ' '` + git log -1 + yarn + yarn build + yarn global:link + cd ${{ github.workspace }} + yarn remove @percy/cli && yarn link `echo $PERCY_PACKAGES` + npx percy --version - run: yarn test:coverage