chore: migrate from Travis CI to Github Actions

This commit is contained in:
harttle
2021-06-20 14:21:34 +08:00
parent cdceb25d00
commit c470d1fe9b
6 changed files with 77 additions and 33 deletions
+27
View File
@@ -0,0 +1,27 @@
name: Check
on: [push, pull_request]
jobs:
release:
name: Check
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10
- name: Build
run: |
npm ci
npm run build
- name: Test
run: |
npm run lint
npm run test
- name: Coverage
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
+40
View File
@@ -0,0 +1,40 @@
name: Release
on:
push:
branches:
- master
jobs:
release:
name: Release
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 10
- name: Build
run: |
npm ci
npm run build
- name: Test
run: |
npm run lint
npm run test
- name: Coverage
uses: coverallsapp/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npx semantic-release
- name: Publish Docs
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: docs/public
+4
View File
@@ -0,0 +1,4 @@
{
"exclude": ["dist", "test"],
"reporter": ["html", "lcov"]
}
-28
View File
@@ -1,28 +0,0 @@
language: node_js
node_js:
- "10"
- "8"
jobs:
include:
- stage: test
name: 'Linting'
script:
- npm run lint
- name: 'Coverage'
script: npm run coverage-coveralls
- stage: release
name: 'Publish'
if: branch = master
script: npm run build
deploy:
provider: script
skip_cleanup: true
script: npx semantic-release
- name: 'Document'
if: branch = master
script: npm run build-docs
deploy:
skip_cleanup: true
provider: pages
github_token: $GH_TOKEN
local_dir: docs/public
+2
View File
@@ -40,6 +40,8 @@
<td align="center"><a href="http://www.ifi.uzh.ch/en/ce/people/schuldenzucker.html"><img src="https://avatars3.githubusercontent.com/u/1100776?v=4" width="100px;" alt="Steffen Schuldenzucker"/></a></td>
<td align="center"><a href="https://github.com/Pixcell"><img src="https://avatars0.githubusercontent.com/u/4005291?v=4" width="100px;" alt="Pixcell"/></a></td>
<td align="center"><a href="https://jasonet.co"><img src="https://avatars.githubusercontent.com/u/10660468?v=4" width="100px;" alt="Jason Etcovitch"/></a></td>
<td align="center"><a href="https://github.com/kayuapi"><img src="https://avatars.githubusercontent.com/u/10304328?v=4" width="100px;" alt="ZC"/></a></td>
<td align="center"><a href="https://memmie.lenglet.name"><img src="https://avatars.githubusercontent.com/u/729275?v=4" width="100px;" alt="Memmie Lenglet"/></a></td>
</tr>
</table>
+4 -5
View File
@@ -16,14 +16,13 @@
"unit": "mocha \"test/unit/**/*.ts\"",
"integration": "mocha \"test/integration/**/*.ts\"",
"e2e": "mocha \"test/e2e/**/*.ts\"",
"test": "cross-env BUNDLES=cjs,umd npm run build && mocha \"test/**/*.ts\"",
"test": "nyc mocha \"test/**/*.ts\"",
"benchmark:prepare": "cd benchmark && npm ci",
"benchmark": "cd benchmark && npm start",
"benchmark:engines": "cd benchmark && npm run engines",
"coverage": "nyc --reporter=html mocha \"test/{unit,integration}/**/*.ts\"",
"coverage-coveralls": "nyc mocha \"test/{unit,integration}/**/*.ts\" && nyc report --reporter=text-lcov | coveralls",
"build": "rm -rf dist && rollup -c rollup.config.ts && ls -lh dist",
"build-docs": "bin/build-docs.sh"
"build": "npm run build:dist && npm run build:docs",
"build:dist": "rm -rf dist && rollup -c rollup.config.ts && ls -lh dist",
"build:docs": "bin/build-docs.sh"
},
"bin": {
"liquidjs": "./bin/liquid.js",