Skip to content

Commit 955c7fc

Browse files
committed
Replace Travis CI with GitHub action
1 parent a9a8e40 commit 955c7fc

File tree

10 files changed

+13622
-124
lines changed

10 files changed

+13622
-124
lines changed

.editorconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
root = true
2+
3+
[*.js]
4+
indent_size = 2
5+
insert_final_newline = true
6+
trim_trailing_whitespace = true
7+
8+
[*.yml]
9+
indent_size = 2
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true

.github/workflows/ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request: {}
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Install dependencies
18+
run: npm ci
19+
20+
- name: Lint (ESlint)
21+
run: npm run lint
22+
23+
- name: Lint (Prettier)
24+
run: npm run check-format
25+
26+
- name: Lint (TypeScript)
27+
run: npm run dtslint
28+
29+
test:
30+
name: Linting
31+
runs-on: ${{ matrix.operating-system }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
operating-system: ['ubuntu-latest']
36+
# https://nodejs.org/en/about/releases/
37+
node-version: ['12', '14', '16', '17']
38+
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@v2
42+
43+
- name: Setup Node.js
44+
uses: actions/setup-node@v2
45+
with:
46+
node-version: ${{ matrix.node-version }}
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Test
52+
run: npm run test

.travis.yml

Lines changed: 0 additions & 39 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ We do linting and formatting in two phases:
7878

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

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

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

README.markdown

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
[![Travis Build Status](https://img.shields.io/travis/wycats/handlebars.js/master.svg)](https://travis-ci.org/wycats/handlebars.js)
2-
[![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)
1+
[![CI Build Status](https://img.shields.io/github/workflow/status/handlebars-lang/handlebars.js/ci/master)](https://github.com/handlebars-lang/handlebars.js/actions)
32
[![Selenium Test Status](https://saucelabs.com/buildstatus/handlebars)](https://saucelabs.com/u/handlebars)
3+
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/handlebars/badge?style=rounded)](https://www.jsdelivr.com/package/npm/handlebars)
4+
[![Bundle size](https://img.shields.io/bundlephobia/minzip/handlebars?label=minified%20%2B%20gzipped)](https://bundlephobia.com/package/handlebars)
5+
[![Install size](https://packagephobia.com/badge?p=handlebars)](https://packagephobia.com/result?p=handlebars)
46

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

107109

108110
Upgrading

appveyor.yml

Lines changed: 0 additions & 36 deletions
This file was deleted.

integration-testing/README.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
Add a new integration test by creating a new subfolder
22

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

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

10-
Currently, integration tests are only running on Linux, especially in travis-ci.
11-
12-
10+
Currently, integration tests are only running on Linux, especially in our CI GitHub action.

integration-testing/multi-nodejs-test/test.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,14 @@ cd "$( dirname "$( readlink -f "$0" )" )" || exit 1
77
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
88

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

1714
unset npm_config_prefix
1815

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

2219
rm target node_modules package-lock.json -rf
2320
mkdir target

0 commit comments

Comments
 (0)