Skip to content

Commit

Permalink
feat(BREAKING): switch to node 14 and only test on safari 12/14, chro…
Browse files Browse the repository at this point in the history
…me, and firefox (#307)
  • Loading branch information
brandonocasey authored May 19, 2021
1 parent 832e757 commit 787424b
Show file tree
Hide file tree
Showing 13 changed files with 1,339 additions and 2,061 deletions.
77 changes: 77 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: ci

on: [push, pull_request]

jobs:
should-skip:
continue-on-error: true
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should-skip-job: ${{steps.skip-check.outputs.should_skip}}
steps:
- id: skip-check
uses: fkirc/[email protected]
with:
github_token: ${{github.token}}

ci:
needs: should-skip
if: ${{needs.should-skip.outputs.should-skip-job != 'true' || github.ref == 'refs/heads/main'}}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
env:
BROWSER_STACK_USERNAME: ${{secrets.BROWSER_STACK_USERNAME}}
BROWSER_STACK_ACCESS_KEY: ${{secrets.BROWSER_STACK_ACCESS_KEY}}
runs-on: ${{matrix.os}}
steps:
- name: checkout code
uses: actions/checkout@v2

- name: Cache dependencies
uses: actions/cache@v2
with:
path: |
~/.npm
**/node_modules
key: ${{runner.os}}-npm-${{hashFiles('**/package-lock.json')}}
restore-keys: |
${{runner.os}}-npm-
${{runner.os}}-
- name: read node version from .nvmrc
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
shell: bash
id: nvm

- name: update apt cache on linux w/o browserstack
run: sudo apt-get update
if: ${{startsWith(matrix.os, 'ubuntu') && !env.BROWSER_STACK_USERNAME}}

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

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

- name: setup node
uses: actions/setup-node@v1
with:
node-version: '${{steps.nvm.outputs.NVMRC}}'

# turn off the default setup-node problem watchers...
- run: echo "::remove-matcher owner=eslint-compact::"
- run: echo "::remove-matcher owner=eslint-stylish::"
- run: echo "::remove-matcher owner=tsc::"

- name: npm install
run: npm i --prefer-offline --no-audit

- name: run npm test
uses: GabrielBB/xvfb-action@v1
with:
run: npm run test
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
14
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

14 changes: 13 additions & 1 deletion generators/app/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const naming = require('./naming');
const packageJSON = require('./package-json');
const validators = require('./validators');
const spawnSync = require('child_process').spawnSync;
const syncRequest = require('sync-request');

module.exports = class extends Generator {

Expand Down Expand Up @@ -213,6 +214,8 @@ module.exports = class extends Generator {
'_.nvmrc'
];

this._filesToDownload = [];

this._templatesToCopy = [
'scripts/_rollup.config.js',
'scripts/_karma.conf.js',
Expand Down Expand Up @@ -266,7 +269,10 @@ module.exports = class extends Generator {
this.context = this._getContext();

if (!this._isPrivate()) {
this._filesToCopy.push('_.travis.yml');
this._filesToDownload.push({
dest: '.github/workflows/ci.yml',
url: 'https://raw.githubusercontent.com/videojs/.github/main/workflow-templates/ci.yml'
});
}

if (this.context.lang) {
Expand Down Expand Up @@ -305,6 +311,12 @@ module.exports = class extends Generator {
this.fs.copy(this.templatePath(src), this._dest(src));
});

this._filesToDownload.forEach(({url, dest}) => {
const response = syncRequest('GET', url);

this.fs.write(this.destinationPath(dest), response.getBody('utf8'));
});

const file = constants.LICENSE_FILES[this.config.get('license')];

if (file) {
Expand Down
8 changes: 2 additions & 6 deletions generators/app/package-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ const packageJSON = (current, context) => {
'generator-videojs-plugin': {
version: generatorVersion()
},
'browserslist': [
'defaults',
'ie 11'
],
'scripts': _.assign({}, current.scripts, {
'build-test': "cross-env-shell TEST_BUNDLE_ONLY=1 'npm run build'",
'build-prod': "cross-env-shell NO_TEST_BUNDLE=1 'npm run build'",
Expand All @@ -144,8 +140,8 @@ const packageJSON = (current, context) => {
}),

'engines': {
node: '>=8',
npm: '>=5'
node: '>=14',
npm: '>=6'
},

// Always include the two minimum keywords with whatever exists in the
Expand Down
2 changes: 1 addition & 1 deletion generators/app/templates/_.nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/*
14
15 changes: 0 additions & 15 deletions generators/app/templates/_.travis.yml

This file was deleted.

Loading

0 comments on commit 787424b

Please sign in to comment.