Skip to content

Commit

Permalink
chore: update CI workflow
Browse files Browse the repository at this point in the history
More updates from videojs/http-streaming#989.
Makes it actually ready for usage now.

As the description says, it requires videojs-generate-karma-config@7 and
newer, karma@5, and a number in the nvmrc file.

We read the nvmrc to know the version to use in the CI action and it can
only use a number directly. Having a single source of truth is better
than having a signal that we're on an lts version.
  • Loading branch information
gkatsev committed Nov 10, 2020
1 parent f766dcb commit 43e052d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion workflow-templates/ci.properties.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Video.js CI Workflow",
"description": "Video.js CI workflow template.",
"description": "Video.js CI workflow template. Requires videojs-generate-karma-config@7, karma@5, and a number in .nvmrc",
"iconName": "qunit",
"categories": [
"JavaScript"
Expand Down
24 changes: 13 additions & 11 deletions workflow-templates/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@ on: [push, pull_request]

jobs:
ci:
env:
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
runs-on: ${{ matrix.os }}
strategy:
# TODO: test IE 11, Legacy Edge, and New Edge on windows-latest
# test Safari on macos-latest
matrix:
os: [ubuntu-latest]

Expand All @@ -27,36 +32,33 @@ jobs:
shell: bash
id: nvm

- name: Install ffmpeg for firefox
- name: Install ffmpeg/pulseaudio for firefox on linux w/o browserstack
run: sudo apt-get install ffmpeg pulseaudio
if: ${{ startsWith(matrix.os, 'ubuntu') }}
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}

- name: start pulseaudio for firefox
- name: start pulseaudio for firefox on linux w/o browserstack
run: pulseaudio -D
if: ${{ startsWith(matrix.os, 'ubuntu') }}
if: ${{ startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME }}

- name: Setup node
uses: actions/setup-node@v1
with:
node-version: '${{ steps.nvm.outputs.NVMRC }}'
- run: npm i --prefer-offline --no-audit

# run safari, chrome, firefox on macos
# run safari on macos
- name: Run Mac test
run: npm run test
run: npm run test -- --browsers Safari
if: ${{ startsWith(matrix.os, 'macos') }}

# only run ie 11 on windows
- name: Run Windows test
run: npm run test
run: npm run test -- --browsers IE
if: ${{ startsWith(matrix.os, 'windows') }}

# run chrome/firefox in linux
# run chrome/firefox or browserstack in linux
- name: Run linux test
uses: GabrielBB/xvfb-action@v1
with:
run: npm test
if: ${{ startsWith(matrix.os, 'ubuntu') }}
env:
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}

0 comments on commit 43e052d

Please sign in to comment.