chore(release): publish #3675
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 16 | |
- name: Set up Docker Compose alias | |
run: | | |
sudo touch /usr/bin/docker-compose | |
echo 'docker compose --compatibility "$@"' | sudo tee /usr/bin/docker-compose | |
sudo chmod +x /usr/bin/docker-compose | |
- 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 | |
run: | | |
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 |