Skip to content

Commit

Permalink
Replace Travis CI with GitHub action
Browse files Browse the repository at this point in the history
  • Loading branch information
jaylinski committed Nov 23, 2021
1 parent a9a8e40 commit 373e0e8
Show file tree
Hide file tree
Showing 10 changed files with 13,624 additions and 124 deletions.
11 changes: 11 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
root = true

[*.js]
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.yml]
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
push:
branches:
- master
pull_request: {}

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

- name: Install dependencies
run: npm ci

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

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

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

test:
name: Testing
runs-on: ${{ matrix.operating-system }}
strategy:
fail-fast: false
matrix:
operating-system: ['ubuntu-latest']
# https://nodejs.org/en/about/releases/
node-version: ['12', '14', '16', '17']

steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}

- name: Install dependencies
run: npm ci

- name: Test
run: npm run test
39 changes: 0 additions & 39 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ We do linting and formatting in two phases:

- Committed files are linted and formatted in a pre-commit hook. In this stage eslint-errors are forbidden,
while warnings are allowed.
- The travis-ci job also lints all files and checks if they are formatted correctly. In this stage, warnings
- The GitHub CI job also lints all files and checks if they are formatted correctly. In this stage, warnings
are forbidden.

You can use the following scripts to make sure that the travis-job does not fail:
You can use the following scripts to make sure that the CI job does not fail:

- **npm run lint** will run `eslint` and fail on warnings
- **npm run format** will run `prettier` on all files
- **npm run check-before-pull-request** will perform all most checks that travis does in its build-job, excluding the "integration-test".
- **npm run check-before-pull-request** will perform all most checks that our CI job does in its build-job, excluding the "integration-test".
- **npm run integration-test** will run integration tests (using old NodeJS versions and integrations with webpack, babel and so on)
These tests only work on a Linux-machine with `nvm` installed (for running tests in multiple versions of NodeJS).

Expand Down
8 changes: 5 additions & 3 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
[![Travis Build Status](https://img.shields.io/travis/wycats/handlebars.js/master.svg)](https://travis-ci.org/wycats/handlebars.js)
[![Appveyor Build Status](https://ci.appveyor.com/api/projects/status/github/wycats/handlebars.js?branch=master&svg=true)](https://ci.appveyor.com/project/wycats/handlebars-js)
[![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)

Handlebars.js
=============
Expand Down Expand Up @@ -102,7 +104,7 @@ does have some big performance advantages. Justin Marney, a.k.a.
[gotascii](http://github.com/gotascii), confirmed that with an
[independent test](http://sorescode.com/2010/09/12/benchmarks.html). The
rewritten Handlebars (current version) is faster than the old version,
with many [performance tests](https://travis-ci.org/wycats/handlebars.js/builds/33392182#L538) being 5 to 7 times faster than the Mustache equivalent.
with many performance tests being 5 to 7 times faster than the Mustache equivalent.


Upgrading
Expand Down
36 changes: 0 additions & 36 deletions appveyor.yml

This file was deleted.

12 changes: 5 additions & 7 deletions integration-testing/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
Add a new integration test by creating a new subfolder

Add a file "test.sh" to that runs the test. "test.sh" should exit with a non-zero exit code
Add a file "test.sh" to that runs the test. "test.sh" should exit with a non-zero exit code
and display an error message, if something goes wrong.

* An integration test should reflect real-world setups that use handlebars.
* It should compile a minimal template and compare the output to an expected output.
* It should use "../.." as dependency for Handlebars so that the currently built library is used.
- An integration test should reflect real-world setups that use handlebars.
- It should compile a minimal template and compare the output to an expected output.
- It should use "../.." as dependency for Handlebars so that the currently built library is used.

Currently, integration tests are only running on Linux, especially in travis-ci.


Currently, integration tests are only running on Linux, especially in our CI GitHub action.
5 changes: 1 addition & 4 deletions integration-testing/multi-nodejs-test/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ cd "$( dirname "$( readlink -f "$0" )" )" || exit 1
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"

# This script tests with precompiler and the built distribution with multiple NodeJS version.
# The rest of the travis-build will only work with newer NodeJS versions, because the build
# tools don't support older versions.
# However, the built distribution should work with older NodeJS versions as well.
# This test is simple by design. It merely ensures, that calling Handlebars does not fail with old versions.
# It does (almost) not test for correctness, because that is already done in the mocha-tests.
# And it does not use any NodeJS based testing framework to make this part independent of the Node version.

unset npm_config_prefix

echo "Handlebars should be able to run in various versions of NodeJS"
for node_version_to_test in 0.10 0.12 4 5 6 7 8 9 10 11 12 13 14 15; do
for node_version_to_test in 12 14 16 17; do

rm target node_modules package-lock.json -rf
mkdir target
Expand Down
Loading

0 comments on commit 373e0e8

Please sign in to comment.