Skip to content

Commit

Permalink
Replace Saucelabs with Playwright
Browse files Browse the repository at this point in the history
Also reorganized npm scripts.
  • Loading branch information
jaylinski committed Dec 22, 2021
1 parent 05fc447 commit 9c3125d
Show file tree
Hide file tree
Showing 18 changed files with 3,496 additions and 489 deletions.
1 change: 0 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*.sublime-project
*.sublime-workspace
npm-debug.log
sauce_connect.log*
.idea
yarn-error.log
node_modules
Expand Down
43 changes: 35 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,22 @@ on:
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm ci

- name: Lint (ESlint)
- name: Lint
run: npm run lint

- name: Lint (Prettier)
run: npm run check-format

- name: Lint (TypeScript)
run: npm run dtslint

test:
name: Test
runs-on: ${{ matrix.operating-system }}
Expand All @@ -52,3 +51,31 @@ jobs:

- name: Test
run: npm run test

browser:
name: Browser Tests
runs-on: 'ubuntu-latest'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install dependencies
run: npm ci

- name: Install Playwright
run: |
npx playwright install-deps
npx playwright install
- name: Build
run: npx grunt prepare

- name: Test
run: npm run test:browser
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*.sublime-project
*.sublime-workspace
npm-debug.log
sauce_connect.log*
.idea
/yarn-error.log
/yarn.lock
Expand All @@ -17,4 +16,4 @@ lib/handlebars/compiler/parser.js
/coverage/
/dist/
/tests/integration/*/dist/
/spec/tmp/*
/spec/tmp/*
89 changes: 15 additions & 74 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,48 +165,6 @@ module.exports = function(grunt) {
}
}
},
'saucelabs-mocha': {
all: {
options: {
build: process.env.TRAVIS_JOB_ID,
urls: [
'http://localhost:9999/spec/?headless=true',
'http://localhost:9999/spec/amd.html?headless=true'
],
detailedError: true,
concurrency: 4,
browsers: [
{ browserName: 'chrome' },
{ browserName: 'firefox', platform: 'Linux' }
// {browserName: 'safari', version: 9, platform: 'OS X 10.11'},
// {browserName: 'safari', version: 8, platform: 'OS X 10.10'},
// {
// browserName: 'internet explorer',
// version: 11,
// platform: 'Windows 8.1'
// },
// {
// browserName: 'internet explorer',
// version: 10,
// platform: 'Windows 8'
// }
]
}
},
sanity: {
options: {
build: process.env.TRAVIS_JOB_ID,
urls: [
'http://localhost:9999/spec/umd.html?headless=true',
'http://localhost:9999/spec/amd-runtime.html?headless=true',
'http://localhost:9999/spec/umd-runtime.html?headless=true'
],
detailedError: true,
concurrency: 2,
browsers: [{ browserName: 'chrome' }]
}
}
},

bgShell: {
integrationTests: {
Expand Down Expand Up @@ -238,59 +196,42 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-babel');
grunt.loadNpmTasks('grunt-bg-shell');
grunt.loadNpmTasks('@knappi/grunt-saucelabs');
grunt.loadNpmTasks('grunt-webpack');

grunt.task.loadTasks('tasks');

this.registerTask(
'build',
'Builds a distributable version of the current project',
['parser', 'node', 'globals']
);

this.registerTask('node', ['babel:cjs']);
this.registerTask('globals', ['webpack']);

this.registerTask('release', 'Build final packages', [
'amd',
grunt.registerTask('node', ['babel:cjs']);
grunt.registerTask('amd', ['babel:amd', 'requirejs']);
grunt.registerTask('globals', ['webpack']);
grunt.registerTask('release', 'Build final packages', [
'uglify',
'test:min',
'copy:dist',
'copy:components',
'copy:cdnjs'
]);

this.registerTask('amd', ['babel:amd', 'requirejs']);

this.registerTask('test', ['test:bin', 'test:cov']);

grunt.registerTask('bench', ['metrics']);

if (process.env.SAUCE_ACCESS_KEY) {
grunt.registerTask('sauce', ['concat:tests', 'connect', 'saucelabs-mocha']);
} else {
grunt.registerTask('sauce', []);
}

// Requires secret properties (saucelabs-credentials etc.) from .travis.yaml
// Requires secret properties from .travis.yaml
grunt.registerTask('extensive-tests-and-publish-to-aws', [
'default',
'bgShell:integrationTests',
'sauce',
'metrics',
'publish-to-aws'
]);
grunt.registerTask('on-file-change', [
'build',
'amd',
'concat:tests',
'test'
]);

grunt.registerTask('on-file-change', ['build', 'concat:tests', 'test']);

// === Primary tasks ===
grunt.registerTask('dev', ['clean', 'connect', 'watch']);
grunt.registerTask('default', ['clean', 'build', 'test', 'release']);
grunt.registerTask('test', ['test:bin', 'test:cov']);
grunt.registerTask('bench', ['metrics']);
grunt.registerTask('prepare', ['build', 'concat:tests']);
grunt.registerTask(
'build',
'Builds a distributable version of the current project',
['parser', 'node', 'amd', 'globals']
);
grunt.registerTask('integration-tests', [
'default',
'bgShell:integrationTests'
Expand Down
3 changes: 0 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![CI Build Status](https://img.shields.io/github/workflow/status/handlebars-lang/handlebars.js/ci/master)](https://github.com/handlebars-lang/handlebars.js/actions)
[![Selenium Test Status](https://saucelabs.com/buildstatus/handlebars)](https://saucelabs.com/u/handlebars)
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/handlebars/badge?style=rounded)](https://www.jsdelivr.com/package/npm/handlebars)
[![Bundle size](https://img.shields.io/bundlephobia/minzip/handlebars?label=minified%20%2B%20gzipped)](https://bundlephobia.com/package/handlebars)
[![Install size](https://packagephobia.com/badge?p=handlebars)](https://packagephobia.com/result?p=handlebars)
Expand Down Expand Up @@ -91,8 +90,6 @@ Handlebars has been designed to work in any ECMAScript 3 environment. This inclu
Older versions and other runtimes are likely to work but have not been formally
tested. The compiler requires `JSON.stringify` to be implemented natively or via a polyfill. If using the precompiler this is not necessary.

[![Selenium Test Status](https://saucelabs.com/browser-matrix/handlebars.svg)](https://saucelabs.com/u/handlebars)

Performance
-----------

Expand Down
Loading

0 comments on commit 9c3125d

Please sign in to comment.