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

feat(BREAKING): switch to node 14 and only test on safari 12/14, chrome, and firefox #307

Merged
merged 9 commits into from
May 19, 2021
Merged
Show file tree
Hide file tree
Changes from 6 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
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.

2 changes: 1 addition & 1 deletion generators/app/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ module.exports = class extends Generator {
this.context = this._getContext();

if (!this._isPrivate()) {
this._filesToCopy.push('_.travis.yml');
this._filesToCopy.push('.github/workflows/_ci.yml');
}

if (this.context.lang) {
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
77 changes: 77 additions & 0 deletions generators/app/templates/.github/workflows/_ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: ci
Copy link
Member

Choose a reason for hiding this comment

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

do we want this here? Since it's sort of specific to Videojs projects only and not everyone may want this. Plus, it'll be yet another place we have to maintain this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe, but we already included the travis config previously and didn't add it to the project if it was closed source. Should we fetch it on install?

Copy link
Member

Choose a reason for hiding this comment

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

downloading it from the .github repo sounds like a good idea. That way we don't have to maintain the script in yet another location.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok I have it downloading now.


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 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