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

[obsolete] #481

Closed
wants to merge 1 commit into from
Closed
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
35 changes: 35 additions & 0 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI

on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-npm-lock-

- name: Use Node.js ${{ matrix.NODE_VERSION }}
uses: actions/[email protected]
with:
node-version: ${{ matrix.NODE_VERSION }}

- name: Install dependencies
run: |
npm install

- name: Run tests
env:
BROWSER_STACK_USERNAME: ${{ secrets.BROWSER_STACK_USERNAME }}
BROWSER_STACK_ACCESS_KEY: ${{ secrets.BROWSER_STACK_ACCESS_KEY }}
run: |
export PATH=${HOME}/firefox:$PATH
npm test
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

24 changes: 12 additions & 12 deletions test/karma/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var grunt = require( "grunt" );

module.exports = function( config ) {
var isTravis = process.env.TRAVIS,
var isCi = process.env.GITHUB_ACTION,
dateString = grunt.config( "dateString" ),
isBrowserStack = !!( process.env.BROWSER_STACK_USERNAME &&
process.env.BROWSER_STACK_ACCESS_KEY ),
Expand Down Expand Up @@ -70,10 +70,10 @@ module.exports = function( config ) {
// Add BrowserStack launchers
customLaunchers: require( "./launchers" ),

// Make travis output less verbose
reporters: isTravis ? "dots" : "progress",
// Make GitHub Actions output less verbose
reporters: isCi ? "dots" : "progress",

colors: !isTravis,
colors: !isCi,

hostname: hostName,
port: 9876,
Expand All @@ -93,16 +93,16 @@ module.exports = function( config ) {
browserDisconnectTolerance: 3
} );

// Deal with Travis environment
if ( isTravis ) {

// Browserstack launcher specifies "build" options as a default value
// of "TRAVIS_BUILD_NUMBER" variable, but this way a bit more verbose
config.browserStack.build = "travis #" + process.env.TRAVIS_BUILD_NUMBER;
// Deal with the GitHub Actions environment
if ( isCi ) {
config.browserStack.build = "GitHub #" + process.env.GITHUB_RUN_NUMBER;

// You can't get access to secure environment variables from pull requests
// so we don't have browserstack from them, but travis has headless Firefox so use that
if ( !isBrowserStack && process.env.TRAVIS_PULL_REQUEST ) {
// so we don't have browserstack from them, but GitHub Actions have headless
// Firefox so use that.
// The `GITHUB_BASE_REF` env variable is only available on PRs, see:
// https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables
if ( !isBrowserStack && process.env.GITHUB_BASE_REF ) {
config.browsers.push( "FirefoxHeadless" );
}
}
Expand Down