Replace Travis CI with GitHub action (#1772)
This commit is contained in:
@@ -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
|
||||||
@@ -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: Test
|
||||||
|
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
@@ -1,39 +0,0 @@
|
|||||||
language: node_js
|
|
||||||
jobs:
|
|
||||||
include:
|
|
||||||
- stage: test
|
|
||||||
name: check javascript (eslint)
|
|
||||||
node_js: lts/*
|
|
||||||
script: npm run lint
|
|
||||||
- stage: test
|
|
||||||
name: check formatting (prettier)
|
|
||||||
node_js: lts/*
|
|
||||||
script: npm run check-format
|
|
||||||
- stage: test
|
|
||||||
name: check typescript definitions (dtslint)
|
|
||||||
node_js: lts/*
|
|
||||||
script: npm run dtslint
|
|
||||||
- stage: test
|
|
||||||
name: extensive tests and publish to aws
|
|
||||||
script: npm run extensive-tests-and-publish-to-aws
|
|
||||||
env:
|
|
||||||
- S3_BUCKET_NAME=builds.handlebarsjs.com
|
|
||||||
- secure: ckyEe5dzjdFDjmZ6wIrhGm0CFBEnKq8c1dYptfgVV/Q5/nJFGzu8T0yTjouS/ERxzdT2H327/63VCxhFnLCRHrsh4rlW/rCy4XI3O/0TeMLgFPa4TXkO8359qZ4CB44TBb3NsJyQXNMYdJpPLTCVTMpuiqqkFFOr+6OeggR7ufA=
|
|
||||||
- secure: Nm4AgSfsgNB21kgKrF9Tl7qVZU8YYREhouQunFracTcZZh2NZ2XH5aHuSiXCj88B13Cr/jGbJKsZ4T3QS3wWYtz6lkyVOx3H3iI+TMtqhD9RM3a7A4O+4vVN8IioB2YjhEu0OKjwgX5gp+0uF+pLEi7Hpj6fupD3AbbL5uYcKg8=
|
|
||||||
- SAUCE_USERNAME=handlebars
|
|
||||||
- secure: 1VkLQhbsEug4ZMQ52tTOus/WLvW3Etqe7GbCzZfzsI8d2ygJPjFfzU8fNm4pVVwoTI21MaM5AQq7SVPu8DWN1YbDjJycMdY1zO3DsB9aZBxTal98fIB7ZIUce9r5z2EP6mETrsbYjZkeckzIBI0A4UVa+F2BO4KbRDXP1Db3u3I=
|
|
||||||
node_js: '10'
|
|
||||||
- stage: test
|
|
||||||
name: test with latest nodejs-lts
|
|
||||||
node_js: lts/*
|
|
||||||
script: npm run test
|
|
||||||
- stage: test
|
|
||||||
name: test with active nodejs
|
|
||||||
node_js: node
|
|
||||||
script: npm run test
|
|
||||||
cache: npm
|
|
||||||
email:
|
|
||||||
on_failure: change
|
|
||||||
on_success: never
|
|
||||||
git:
|
|
||||||
depth: 100
|
|
||||||
+3
-3
@@ -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,
|
- Committed files are linted and formatted in a pre-commit hook. In this stage eslint-errors are forbidden,
|
||||||
while warnings are allowed.
|
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.
|
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 lint** will run `eslint` and fail on warnings
|
||||||
- **npm run format** will run `prettier` on all files
|
- **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)
|
- **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).
|
These tests only work on a Linux-machine with `nvm` installed (for running tests in multiple versions of NodeJS).
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -1,6 +1,8 @@
|
|||||||
[](https://travis-ci.org/wycats/handlebars.js)
|
[](https://github.com/handlebars-lang/handlebars.js/actions)
|
||||||
[](https://ci.appveyor.com/project/wycats/handlebars-js)
|
|
||||||
[](https://saucelabs.com/u/handlebars)
|
[](https://saucelabs.com/u/handlebars)
|
||||||
|
[](https://www.jsdelivr.com/package/npm/handlebars)
|
||||||
|
[](https://bundlephobia.com/package/handlebars)
|
||||||
|
[](https://packagephobia.com/result?p=handlebars)
|
||||||
|
|
||||||
Handlebars.js
|
Handlebars.js
|
||||||
=============
|
=============
|
||||||
@@ -102,7 +104,7 @@ does have some big performance advantages. Justin Marney, a.k.a.
|
|||||||
[gotascii](http://github.com/gotascii), confirmed that with an
|
[gotascii](http://github.com/gotascii), confirmed that with an
|
||||||
[independent test](http://sorescode.com/2010/09/12/benchmarks.html). The
|
[independent test](http://sorescode.com/2010/09/12/benchmarks.html). The
|
||||||
rewritten Handlebars (current version) is faster than the old version,
|
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
|
Upgrading
|
||||||
|
|||||||
@@ -1,36 +0,0 @@
|
|||||||
# Test against these versions of Node.js
|
|
||||||
environment:
|
|
||||||
matrix:
|
|
||||||
- nodejs_version: "10"
|
|
||||||
|
|
||||||
platform:
|
|
||||||
- x64
|
|
||||||
|
|
||||||
# Install scripts (runs after repo cloning)
|
|
||||||
install:
|
|
||||||
# Get the latest stable version of Node.js
|
|
||||||
- ps: Install-Product node $env:nodejs_version $env:platform
|
|
||||||
# Clone submodules (mustache spec)
|
|
||||||
- cmd: git submodule update --init --recursive
|
|
||||||
# Install modules
|
|
||||||
- cmd: npm ci
|
|
||||||
|
|
||||||
|
|
||||||
# Post-install test scripts
|
|
||||||
test_script:
|
|
||||||
# Output useful info for debugging
|
|
||||||
- cmd: node --version
|
|
||||||
- cmd: npm --version
|
|
||||||
# Run tests
|
|
||||||
- cmd: npm run test
|
|
||||||
|
|
||||||
# Don't actually build
|
|
||||||
build: off
|
|
||||||
|
|
||||||
on_failure:
|
|
||||||
- cmd: 7z a coverage.zip coverage
|
|
||||||
- cmd: appveyor PushArtifact coverage.zip
|
|
||||||
|
|
||||||
|
|
||||||
# Set build version format here instead of in the admin panel
|
|
||||||
version: "{build}"
|
|
||||||
@@ -1,12 +1,10 @@
|
|||||||
Add a new integration test by creating a new subfolder
|
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.
|
and display an error message, if something goes wrong.
|
||||||
|
|
||||||
* An integration test should reflect real-world setups that use handlebars.
|
- 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 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.
|
- 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.
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ cd "$( dirname "$( readlink -f "$0" )" )" || exit 1
|
|||||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||||
|
|
||||||
# This script tests with precompiler and the built distribution with multiple NodeJS version.
|
# 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.
|
# 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.
|
# 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.
|
# And it does not use any NodeJS based testing framework to make this part independent of the Node version.
|
||||||
|
|||||||
Generated
+13544
-31
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -3,7 +3,7 @@
|
|||||||
"barename": "handlebars",
|
"barename": "handlebars",
|
||||||
"version": "4.7.7",
|
"version": "4.7.7",
|
||||||
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration",
|
"description": "Handlebars provides the power necessary to let you build semantic templates effectively with no frustration",
|
||||||
"homepage": "http://www.handlebarsjs.com/",
|
"homepage": "https://www.handlebarsjs.com/",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"handlebars",
|
"handlebars",
|
||||||
"mustache",
|
"mustache",
|
||||||
|
|||||||
Reference in New Issue
Block a user