From d605299c1df2c53f7f5f8ea8ed75678b0b44c859 Mon Sep 17 00:00:00 2001 From: Vitaliy Stoliarov Date: Sat, 23 Dec 2023 16:01:01 +0200 Subject: [PATCH] Create update-snapshots.yml --- .github/workflows/update-snapshots.yml | 67 ++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/update-snapshots.yml diff --git a/.github/workflows/update-snapshots.yml b/.github/workflows/update-snapshots.yml new file mode 100644 index 0000000..61a941b --- /dev/null +++ b/.github/workflows/update-snapshots.yml @@ -0,0 +1,67 @@ +name: Update snaphots + +on: + workflow_dispatch: + inputs: + name: + required: true + type: choice + description: Stack + options: + - react + - vue + - angular + - svelte + version: + required: true + type: number + description: Stack version + node: + type: number + description: 'Node.js version (default: 16)' + + +jobs: + test: + timeout-minutes: 30 + runs-on: ubuntu-latest + # TODO reuse steps from regression.yml + steps: + - name: Install fonts + run: | + sudo apt-get -qqy update + sudo apt-get -qqy --no-install-recommends install \ + libfontconfig \ + libfreetype6 \ + xfonts-cyrillic \ + xfonts-scalable \ + fonts-liberation \ + fonts-ipafont-gothic \ + fonts-wqy-zenhei \ + fonts-tlwg-loma-otf \ + fonts-freefont-ttf + sudo rm -rf /var/lib/apt/lists/* + sudo apt-get -qyy clean + - uses: actions/setup-node@v3 + with: + node-version: ${{ github.event.inputs.node || 16 }} + - name: Install Rete QA + run: npm i -g rete-qa rete-kit + - name: Install Playwright Browsers + run: npx playwright install --with-deps + - name: Init application + run: rete-qa init -s ${{ github.event.inputs.name }} -sv ${{ github.event.inputs.version }} + env: + CI: "" + - name: Update snapshots + run: rete-qa test -s ${{ github.event.inputs.name }} -sv ${{ github.event.inputs.version }} -u + - name: Get path to snapshots + id: get_snapshots + run: echo "::set-output name=path::$(npm root -g)/rete-qa/snapshots/${{ github.event.inputs.name }}${{ github.event.inputs.version }}" + - uses: actions/upload-artifact@v3 + if: always() + with: + name: snapshots + path: ${{ steps.get_snapshots.outputs.path }} + retention-days: 7 +