Skip to content

adhmenon is running Pull Request CI #43

adhmenon is running Pull Request CI

adhmenon is running Pull Request CI #43

Workflow file for this run

name: Pull Request CI
run-name: ${{ github.actor }} is running Pull Request CI
on:
pull_request_target:
branches:
- ccwidgets
types: [opened, labeled, reopened, synchronize]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
rid: ${{ github.run_id }}-${{ github.run_number }}
jobs:
validate:
name: Validate Pull Request
runs-on: ubuntu-latest
if: contains(toJson(github.event.pull_request.labels), 'validated')
steps:
- name: Validate PR title
run: |
TITLE="${{ github.event.pull_request.title }}"
echo "PR Title is: '$TITLE'"
regex="^(fix|feat|chore)\([^()]+\): .+"
if [[ $TITLE =~ $regex ]]; then
echo "PR title is valid."
else
echo "Error: PR title does NOT follow the required convention."
echo "Expected format: fix|feat|chore(some-text): description..."
exit 1
fi
install:
runs-on: ubuntu-latest
needs: validate
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- id: validate-dependencies
name: Validate Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- id: lock-hash
name: Store Lock Hash
run: echo "hash=$(echo ${{ hashFiles('./yarn.lock') }})" >> $GITHUB_OUTPUT
- name: Install Dependencies
run: yarn
- name: Cache Dependencies
uses: actions/cache@v3
if: steps.validate-dependencies.outputs.cache-hit != 'true'
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
build:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Build meetings widget
run: yarn workspace @webex/widgets run build:src
- name: Build cc widgets
run: yarn run build
- name: Cache Distributables
uses: actions/cache@v3
with:
path: '**/dist'
key: dist-${{ env.rid }}
linter:
runs-on: ubuntu-latest
needs: install
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Test linting in meetings widget
run: yarn workspace @webex/widgets run test:eslint
- name: Test linting in cc widgets
run: yarn run test:styles
e2e_test_meetings:
runs-on: ubuntu-latest
continue-on-error: true
needs: [install, build]
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Uncache Distributables
uses: actions/cache@v3
with:
path: '**/dist'
key: dist-${{ env.rid }}
- name: Test E2E
run: yarn workspace @webex/widgets run test:e2e
unit_tests:
runs-on: ubuntu-latest
needs: [install, build]
steps:
- name: Checkout Project
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node
uses: actions/setup-node@v3.7.0
with:
node-version-file: '.nvmrc'
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Uncache Distributables
uses: actions/cache@v3
with:
path: '**/dist'
key: dist-${{ env.rid }}
- name: Test Tooling
run: yarn run test:tooling
- name: Test CC Widgets
run: yarn run test:cc-widgets