Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(WEBRTC-366): testing workflow #143

Merged
merged 15 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 75 additions & 7 deletions .github/workflows/webrtc-test-release.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
name: '@telnyx/webrtc Test release'

on:
pull_request:
paths:
- 'packages/js/**'

workflow_dispatch:
inputs:
package:
description: '@telnyx/webrtc Test'
required: true
default: 'webrtc'
jobs:
build:
name: Test release

unit-tests:
name: Unit Test
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
with:
Expand All @@ -32,6 +34,72 @@ jobs:
run: npm test
env:
CI: true

cypress-run-chrome:
runs-on: ubuntu-16.04
# let's make sure our tests pass on Chrome browser
name: E2E tests on Chrome and Firefox
steps:
- uses: actions/checkout@v2
with:
# https://github.com/peter-evans/create-pull-request/issues/122
ref: 'main'
# https://github.com/release-it/release-it/issues/657#issuecomment-647848200
fetch-depth: 0
- name: Use Node.js 11.x
uses: actions/setup-node@v1
with:
node-version: '11.x'
- name: Install Cypress Dependency
working-directory: packages/js/examples/react-audio-widgets
run: npm install -D cypress
- name: Install react-audio-widgets dependencies
working-directory: packages/js/examples/react-audio-widgets
run: npm ci --ignore-scripts
- name: Run Storybook Audio Widgets
working-directory: packages/js/examples/react-audio-widgets
run: npm run storybook &
env:
CI: true
STORYBOOK_USERNAME: ${{ secrets.NPM_CI_STORYBOOK_USERNAME }}
STORYBOOK_PASSWORD: ${{ secrets.NPM_CI_STORYBOOK_PASSWORD }}
STORYBOOK_DESTINATION: ${{ secrets.NPM_CI_STORYBOOK_DESTINATION }}
- name: Test on Chrome
working-directory: packages/js/examples/react-audio-widgets
run: npm run cypress:ci:chrome
env:
CI: true
STORYBOOK_USERNAME: ${{ secrets.NPM_CI_STORYBOOK_USERNAME }}
STORYBOOK_PASSWORD: ${{ secrets.NPM_CI_STORYBOOK_PASSWORD }}
STORYBOOK_DESTINATION: ${{ secrets.NPM_CI_STORYBOOK_DESTINATION }}
- name: Test on Firefox
working-directory: packages/js/examples/react-audio-widgets
run: npm run cypress:ci:firefox
env:
CI: true
STORYBOOK_USERNAME: ${{ secrets.NPM_CI_STORYBOOK_USERNAME }}
STORYBOOK_PASSWORD: ${{ secrets.NPM_CI_STORYBOOK_PASSWORD }}
STORYBOOK_DESTINATION: ${{ secrets.NPM_CI_STORYBOOK_DESTINATION }}

build:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like it could be consolidated with unit-tests

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to keep separated, I did 3 steps:

  • unit-test
  • e2e
  • build/release

name: Build SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
# https://github.com/peter-evans/create-pull-request/issues/122
ref: 'main'
# https://github.com/release-it/release-it/issues/657#issuecomment-647848200
fetch-depth: 0
- name: Use Node.js 11.x
uses: actions/setup-node@v1
with:
node-version: '11.x'
- name: Install shared dependencies
run: npm ci
- name: Install package dependencies
working-directory: packages/js
run: npm ci --ignore-scripts
- name: Build
working-directory: packages/js
run: npm run build
Expand All @@ -47,4 +115,4 @@ jobs:
--no-npm.tag
env:
NPM_TOKEN: ${{ secrets.NPM_CI_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 2 additions & 1 deletion packages/js/examples/react-audio-widgets/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ coverage
cypress/integration/examples
cypress/videos/*
cypress/screenshots/*
.env
.env
yarn.lock
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why add the lockfile to gitignore? Also, it looks like the file was committed to this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we use the command npm ci we need to remove the yarn.lock, because the GITHUB/ACTIONS complain about that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Run cypress-io/github-action@v2
/usr/bin/yarn --frozen-lockfile
yarn install v1.22.5
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
warning cypress > @cypress/request > [email protected]: this library is no longer supported
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: The process '/usr/bin/yarn' failed with exit code 1
`
``

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think they meant you should remove package-lock.json file instead, as it could potentially be used instead of yarn.lock.

Loading