From c470d1fe9b835902409fc08258e78dc69b334d30 Mon Sep 17 00:00:00 2001 From: harttle Date: Sun, 20 Jun 2021 14:11:39 +0800 Subject: [PATCH] chore: migrate from Travis CI to Github Actions --- .github/workflows/check.yml | 27 +++++++++++++ .github/workflows/release.yml | 40 +++++++++++++++++++ .nycrc.json | 4 ++ .travis.yml | 28 ------------- .../navy/layout/partial/all-contributors.swig | 2 + package.json | 9 ++--- 6 files changed, 77 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/check.yml create mode 100644 .github/workflows/release.yml create mode 100644 .nycrc.json delete mode 100644 .travis.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml new file mode 100644 index 0000000000..a69e178119 --- /dev/null +++ b/.github/workflows/check.yml @@ -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/github-action@v1.1.2 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000000..b95bab7a53 --- /dev/null +++ b/.github/workflows/release.yml @@ -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/github-action@v1.1.2 + 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/github-pages-deploy-action@4.1.4 + with: + branch: gh-pages + folder: docs/public \ No newline at end of file diff --git a/.nycrc.json b/.nycrc.json new file mode 100644 index 0000000000..ba50746de3 --- /dev/null +++ b/.nycrc.json @@ -0,0 +1,4 @@ +{ + "exclude": ["dist", "test"], + "reporter": ["html", "lcov"] +} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index dbccdd5ac3..0000000000 --- a/.travis.yml +++ /dev/null @@ -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 diff --git a/docs/themes/navy/layout/partial/all-contributors.swig b/docs/themes/navy/layout/partial/all-contributors.swig index 4120bdb51e..061943ca83 100644 --- a/docs/themes/navy/layout/partial/all-contributors.swig +++ b/docs/themes/navy/layout/partial/all-contributors.swig @@ -40,6 +40,8 @@ Steffen Schuldenzucker Pixcell Jason Etcovitch + ZC + Memmie Lenglet diff --git a/package.json b/package.json index 32bf8eb9cf..df0c09e95b 100644 --- a/package.json +++ b/package.json @@ -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",