Skip to content

Shreyas281299 is running Pull Request CI #4

Shreyas281299 is running Pull Request CI

Shreyas281299 is running Pull Request CI #4

Workflow file for this run

name: Pull Request CI
run-name: ${{ github.actor }} is running Pull Request CI
on:
pull_request_target:
types: [opened, labeled, reopened, synchronize]
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
initialize:
runs-on: ubuntu-latest
env:
AWS_BUCKET: code.s4d.io
AWS_REGION: us-east-1
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.13.1
- name: Clean yarn cache
run: yarn cache clean
- name: Initialize dependencies
run: yarn install
- 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') }}
unit_tests_and_linting:
runs-on: ubuntu-latest
needs: initialize
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.13.1
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: "**/node_modules"
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Run eslint
run: yarn run eslint --format junit -o reports/junit/js-lint-results.xml
- name: Build packages
run: yarn run build:all
- name: Run Jest test suites
env:
JEST_JUNIT_OUTPUT_NAME: js-jest-results.xml
JEST_JUNIT_OUTPUT_DIR: reports/junit/jest
run: yarn workspaces foreach -A run test:unit
- name: Upload Jest test results
uses: actions/upload-artifact@v3
with:
name: junit-test-results
path: reports/junit
build_for_tests:
runs-on: ubuntu-latest
needs: initialize
env:
FEDERATION: true
NODE_ENV: test
WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL: https://conversation-intb.ciscospark.com/conversation/api/v1
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.13.1
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: "**/node_modules"
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: Build for test
run: yarn run build journey dist-test
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: dist-test
path: dist-test
journey_tests_chrome:
runs-on: ubuntu-latest
needs: build_for_tests
env:
SAUCE: true
STATIC_SERVER_PATH: dist-test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.13.1
- name: Create Environment Variables
run: |
touch .env
echo "WEBEX_CONVERSATION_DEFAULT_CLUSTER=urn:TEAM:us-east-1_a:identityLookup" >> .env
echo "WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL=https://conv-a.wbx2.com/conversation/api/v1" >> .env
echo "IDBROKER_BASE_URL=https://idbroker.webex.com" >> .env
echo "U2C_SERVICE_URL=https://u2c.wbx2.com/u2c/api/v1" >> .env
echo "WDM_SERVICE_URL=https://wdm-a.wbx2.com/wdm/api/v1" >> .env
cat .env
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: "**/node_modules"
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: initialize WebDriver dependencies
run: |
yarn initialize -g webdriver-manager
webdriver-manager update
- name: initialize Chrome browser
run: |
sudo apt-get update
sudo apt-get initialize -y google-chrome-stable
- name: Start Xvfb
run: |
sudo apt-get initialize -y xvfb
Xvfb :99 & export DISPLAY=:99
- name: Run integration tests on Chrome
run: BROWSER=chrome yarn run test:integration
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: integration-test-results
path: reports/junit/wdio
journey_tests_firefox:
runs-on: ubuntu-latest
needs: build_for_tests
env:
SAUCE: true
STATIC_SERVER_PATH: dist-test
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20.13.1
- name: Create Environment Variables
run: |
touch .env
echo "WEBEX_CONVERSATION_DEFAULT_CLUSTER=urn:TEAM:us-east-1_a:identityLookup" >> .env
echo "WEBEX_TEST_USERS_CONVERSATION_SERVICE_URL=https://conv-a.wbx2.com/conversation/api/v1" >> .env
echo "IDBROKER_BASE_URL=https://idbroker.webex.com" >> .env
echo "U2C_SERVICE_URL=https://u2c.wbx2.com/u2c/api/v1" >> .env
echo "WDM_SERVICE_URL=https://wdm-a.wbx2.com/wdm/api/v1" >> .env
cat .env
- name: Uncache Dependencies
uses: actions/cache@v3
with:
path: "**/node_modules"
key: node-modules-${{ hashFiles('./yarn.lock') }}
- name: initialize WebDriver dependencies
run: |
yarn initialize -g webdriver-manager
webdriver-manager update
- name: initialize Firefox browser
run: |
sudo apt-get update
sudo apt-get initialize -y firefox
- name: Start Xvfb
run: |
sudo apt-get initialize -y xvfb
Xvfb :99 & export DISPLAY=:99
- name: Run integration tests on Firefox
run: BROWSER=firefox yarn run test:integration
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: integration-test-results
path: reports/junit/wdio