Skip to content

Update build-pr.yml #3618

Update build-pr.yml

Update build-pr.yml #3618

Workflow file for this run

name: build-pr
on:
pull_request:
branches:
- main
jobs:
# prettier:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Restore Lerna
# id: yarn-cache
# uses: actions/cache@v2
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
# - name: Install project dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn
# - name: Run Lerna bootstrap
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: |
# yarn bootstrap
# - name: Run Prettier
# run: |
# yarn format
# - name: Check for uncommitted changes
# run: |
# sh scripts/porcelain.sh
# tslint:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Restore Lerna
# id: yarn-cache
# uses: actions/cache@v2
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
# - name: Install project dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn
# - name: Run Lerna bootstrap
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: |
# yarn bootstrap
# - name: Run TSLint
# run: |
# yarn workspace @telekom/scale-components lint
# unit-tests:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Restore Lerna
# id: yarn-cache
# uses: actions/cache@v2
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
# - name: Install project dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn
# - name: Run Lerna bootstrap
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: |
# yarn bootstrap
# - name: Run unit tests
# run: |
# yarn workspace @telekom/scale-components test --spec --max-workers=8
# e2e-tests:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Restore Lerna
# id: yarn-cache
# uses: actions/cache@v2
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
# - name: Install project dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn
# - name: Run Lerna bootstrap
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: |
# yarn bootstrap
# - name: Generate files
# run: |
# yarn lerna run generate
# - name: Run e2e tests
# run: |
# yarn workspace @telekom/scale-components test --e2e --max-workers=8 --debug
visual-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v2
with:
node-version: 16
- name: Ensure docker-compose exists and has correct permissions
run: |
sudo touch /usr/bin/docker-compose
sudo chmod 755 /usr/bin/docker-compose
docker-compose -v
- name: Restore Lerna
id: yarn-cache
uses: actions/cache@v2
with:
path: |
node_modules
*/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
- name: Install project dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn
- name: Run Lerna bootstrap
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: |
yarn bootstrap
- name: Generate files
run: |
yarn lerna run generate
- name: Build Components
if: steps.components-cache.outputs.cache-hit != 'true'
run: |
yarn workspace @telekom/scale-components build
- name: Build Storybook
if: steps.storybook-cache.outputs.cache-hit != 'true'
run: |
yarn workspace @telekom/scale-storybook-vue build --quiet
- name: Copy Storybook for visual tests
run: |
yarn workspace @telekom/scale-visual-tests copy
- name: Run visual tests
id: visual-tests
env:
CI: true
PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: "true"
run: |
sudo ln -s /usr/bin/docker /usr/local/bin/docker-compose
yarn workspace @telekom/scale-visual-tests test:ci -u
- name: Check for any snapshots changes
run: |
sh scripts/porcelain.sh
- name: Set patch branch name
if: failure()
id: vars
run: echo ::set-output name=branch-name::"visual-snapshots/${{ github.head_ref }}"
- name: Create pull request with new snapshots
if: failure()
uses: peter-evans/create-pull-request@v4
with:
commit-message: 'test(visual): update snapshots'
title: 'update visual snapshots: ${{ github.event.pull_request.title }}'
body: This is an auto-generated PR with visual snapshot updates for \#${{ github.event.number }}.
labels: automated pr
branch: ${{ steps.vars.outputs.branch-name }}
# uncommitted-changes:
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v3
# with:
# node-version: 16
# - name: Restore Lerna
# id: yarn-cache
# uses: actions/cache@v2
# with:
# path: |
# node_modules
# */*/node_modules
# key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
# - name: Install project dependencies
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: yarn
# - name: Run Lerna bootstrap
# if: steps.yarn-cache.outputs.cache-hit != 'true'
# run: |
# yarn bootstrap
# - name: Generate files
# run: |
# yarn lerna run generate
# - name: Build Components
# run: |
# yarn workspace @telekom/scale-components build
# - name: Check for uncommitted changes
# run: |
# sh scripts/porcelain.sh