Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Build and test CI #1089

Build and test CI

Build and test CI #1089

Workflow file for this run

# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Build and test CI
on:
push:
schedule:
- cron: '0 12 * * 1-5'
# Every day from Monday to Friday at noon
jobs:
build:
name: Jest run (unit tests)
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install -g yarn
- run: yarn
- run: yarn test
publish-plugin:
name: Publish plugin
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install
uses: cypress-io/github-action@v2
with:
runTests: false
- name: Install plugin dependencies
working-directory: cypress/fixtures/plugin
run: yarn
- name: Create environment file
uses: finnp/create-file-action@1.0.0
env:
FILE_NAME: "cypress/fixtures/plugin/environments.json"
FILE_DATA: "{ \"development\": { \"name\": \"${{ secrets.PLUGIN_IFRAME_NAME}}\", \"endpoint\": \"https://plugins.livestorm.co/\", \"apiKey\": \"${{ secrets.API_KEY}}\" }, \"staging\": { \"name\": \"plugin-e2e\", \"endpoint\": \"${{ secrets.PLUGINS_ENDPOINT_STAGING }}\", \"apiKey\": \"${{ secrets.PLUGINS_API_KEY_STAGING }}\" } }"
- name: Publish plugin (STAGING)
working-directory: cypress/fixtures/plugin
run: yarn livestorm publish staging
- name: Publish plugin (PROD)
working-directory: cypress/fixtures/plugin
run: yarn livestorm publish
cypress-run:
name: Cypress run (E2E tests)
runs-on: ubuntu-latest
strategy:
matrix:
site: ["PROD"]
needs: publish-plugin
steps:
- uses: actions/checkout@v2
- name: Cypress run
uses: cypress-io/github-action@v2
with:
spec: cypress/integration/spec-*.ts
config: baseUrl=${{ secrets[format('BASE_URL_{0}', matrix.site)] }},defaultCommandTimeout=10000,viewportWidth=1680,viewportHeight=1050,chromeWebSecurity=false,retries=3
config-file: false
record: true
browser: chrome
env:
CYPRESS_SITE: ${{ matrix.site }}
CYPRESS_SITE_AUTHORIZATION: ${{ secrets[format('SITE_AUTHORIZATION_{0}', matrix.site)] }}
CYPRESS_TEAM_MEMBER_EMAIL: ${{ secrets[format('TEAM_MEMBER_EMAIL_{0}', matrix.site)] }}
CYPRESS_TEAM_MEMBER_PASSWORD: ${{ secrets[format('TEAM_MEMBER_PASSWORD_{0}', matrix.site)] }}
CYPRESS_EVENT_ID: ${{ secrets[format('EVENT_ID_{0}', matrix.site)] }}
CYPRESS_PUBLIC_API_KEY: ${{ secrets[format('PUBLIC_API_KEY_{0}', matrix.site)] }}
CYPRESS_PUBLIC_API_BASE_URL: ${{ secrets[format('PUBLIC_API_BASE_URL_{0}', matrix.site)] }}
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
CYPRESS_PLUGIN_IFRAME_NAME: ${{ secrets.PLUGIN_IFRAME_NAME }}
CYPRESS_MAGIC_PARAMETER: ${{ secrets.MAGIC_PARAMETER }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}