Browse Source

Setup GitHub actions

Zihua Li 2 years ago
parent
commit
bac6b0e965

+ 13 - 0
.github/workflows/main.yml

@@ -0,0 +1,13 @@
+name: Main
+
+on:
+  push:
+    branches: [develop]
+
+concurrency:
+  group: main-build
+  cancel-in-progress: true
+
+jobs:
+  test:
+    uses: ./.github/workflows/test.yml

+ 9 - 0
.github/workflows/pull-request.yml

@@ -0,0 +1,9 @@
+name: Pull Requests
+
+on:
+  pull_request:
+    branches: [develop]
+
+jobs:
+  test:
+    uses: ./.github/workflows/test.yml

+ 38 - 0
.github/workflows/test.yml

@@ -0,0 +1,38 @@
+on:
+  workflow_call:
+
+jobs:
+  test:
+    runs-on: ubuntu-latest
+    strategy:
+      fail-fast: false
+      matrix:
+        browser: [
+            mac-chrome-latest,
+            mac-firefox-latest,
+            mac-safari-latest,
+            windows-chrome-latest,
+            windows-firefox-latest,
+            windows-edge-latest,
+            ios-latest,
+            # android-latest,
+          ]
+
+    steps:
+      - name: Git checkout
+        uses: actions/checkout@v2
+
+      - name: Use Node.js
+        uses: actions/setup-node@v1
+        with:
+          node-version: 16.x
+          cache: npm
+
+      - run: npm ci
+        env:
+          PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: 1
+      - run: npm run lint
+      - run: npm run test:unit:ci
+        env:
+          BROWSER: ${{ matrix.browser }}
+      - run: npm run test:random

+ 1 - 0
.gitignore

@@ -3,6 +3,7 @@
 !.eslintignore
 !.npmignore
 !.gitignore
+!.github
 
 /dist
 /node_modules

+ 0 - 27
.travis.yml

@@ -1,27 +0,0 @@
-language: node_js
-node_js: '10'
-script:
-  - npm run build
-  - travis_retry npm run travis
-os:
-  - linux
-dist: xenial
-cache:
-  directories:
-    - dist
-    - node_modules
-env:
-  global:
-    - PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1
-  jobs:
-    - BROWSER=mac-chrome-latest
-    - BROWSER=mac-firefox-latest
-    - BROWSER=mac-safari-latest
-    - BROWSER=windows-chrome-latest
-    - BROWSER=windows-firefox-latest
-    - BROWSER=windows-edge-latest
-    - BROWSER=ios-latest
-    - BROWSER=android-latest
-jobs:
-  allow_failures:
-    - env: BROWSER=android-latest

+ 2 - 2
README.md

@@ -18,8 +18,8 @@ Note: This branch and README covers the upcoming 2.0 release. View [1.x docs her
   <a title="Interactive Playground" href="https://quilljs.com/playground/"><strong>Interactive Playground</strong></a>
 </p>
 <p align="center">
-  <a href="https://travis-ci.org/quilljs/quill" title="Build Status">
-    <img src="https://app.travis-ci.com/quilljs/quill.svg?branch=develop" alt="Build Status">
+  <a href="https://github.com/quilljs/quill/actions" title="Build Status">
+    <img src="https://github.com/quilljs/quill/actions/workflows/main.yml/badge.svg" alt="Build Status">
   </a>
   <a href="https://npmjs.com/package/quill" title="Version">
     <img src="https://img.shields.io/npm/v/quill.svg" alt="Version">

+ 1 - 1
_develop/karma.config.js

@@ -54,7 +54,7 @@ module.exports = config => {
   });
 
   /* eslint-disable no-param-reassign */
-  if (process.env.TRAVIS) {
+  if (process.env.GITHUB_ACTION) {
     config.transports = ['polling'];
     config.browsers = [process.env.BROWSER];
     config.browserDisconnectTimeout = 10000;

+ 2 - 2
package.json

@@ -99,9 +99,9 @@
     "test:all": "npm run test:unit; npm run test:functional; npm run test:random",
     "test:functional": "./_develop/scripts/puppeteer.sh",
     "test:unit": "npm run build; karma start _develop/karma.config.js",
+    "test:unit:ci": "npm run build; karma start _develop/karma.config.js --reporters dots,saucelabs",
     "test:random": "ts-node --preferTsExts -O '{\"module\":\"commonjs\"}' ./node_modules/.bin/jasmine test/random.ts",
-    "test:coverage": "webpack --env.coverage --config _develop/webpack.config.js; karma start _develop/karma.config.js --reporters coverage",
-    "travis": "npm run lint && karma start _develop/karma.config.js --reporters dots,saucelabs"
+    "test:coverage": "webpack --env.coverage --config _develop/webpack.config.js; karma start _develop/karma.config.js --reporters coverage"
   },
   "keywords": [
     "editor",

+ 55 - 0
website/src/data/api.js

@@ -0,0 +1,55 @@
+const items = [
+    {
+        title: 'Content',
+        hashes: [
+            'deleteText',
+            'getContents',
+            'getLength',
+            'getText',
+            'insertEmbed',
+            'insertText',
+            'setContents',
+            'setText',
+            'updateContents',
+        ],
+    },
+    {
+        title: 'Formatting',
+        hashes: ['format', 'formatLine', 'formatText', 'getFormat', 'removeFormat'],
+    },
+    {
+        title: 'Selection',
+        hashes: ['getBounds', 'getSelection', 'setSelection'],
+    },
+    {
+        title: 'Editor',
+        hashes: ['blur', 'focus', 'disable', 'enable', 'hasFocus', 'update'],
+    },
+    {
+        title: 'Events',
+        hashes: [
+            'text-change',
+            'selection-change',
+            'editor-change',
+            'off',
+            'on',
+            'once',
+        ],
+    },
+    {
+        title: 'Model',
+        hashes: [
+            'find-experimental',
+            'getIndex-experimental',
+            'getLeaf-experimental',
+            'getLine-experimental',
+            'getLines-experimental',
+        ],
+    },
+    {
+        title: 'Extension',
+        hashes: ['debug', 'import', 'register', 'addContainer', 'getModule'],
+    },
+];
+export default items;
+//# sourceMappingURL=api.js.map

+ 88 - 0
website/src/data/docs.js

@@ -0,0 +1,88 @@
+const items = [
+    {
+        title: 'Quickstart',
+        url: '/docs/quickstart/',
+    },
+    {
+        title: 'Download',
+        url: '/docs/download/',
+    },
+    {
+        title: 'Configuration',
+        url: '/docs/configuration/',
+    },
+    {
+        title: 'Formats',
+        url: '/docs/formats/',
+    },
+    {
+        title: 'API',
+        url: '/docs/api/',
+        children: [
+            {
+                title: 'Content',
+                url: '/docs/api/#content',
+            },
+            {
+                title: 'Formatting',
+                url: '/docs/api/#formatting',
+            },
+            {
+                title: 'Selection',
+                url: '/docs/api/#selection',
+            },
+            {
+                title: 'Editor',
+                url: '/docs/api/#editor',
+            },
+            {
+                title: 'Events',
+                url: '/docs/api/#events',
+            },
+            {
+                title: 'Model',
+                url: '/docs/api/#model',
+            },
+            {
+                title: 'Extension',
+                url: '/docs/api/#extension',
+            },
+        ],
+    },
+    {
+        title: 'Delta',
+        url: '/docs/delta/',
+    },
+    {
+        title: 'Modules',
+        url: '/docs/modules/',
+        children: [
+            {
+                title: 'Toolbar',
+                url: '/docs/modules/toolbar/',
+            },
+            {
+                title: 'Keyboard',
+                url: '/docs/modules/keyboard/',
+            },
+            {
+                title: 'History',
+                url: '/docs/modules/history/',
+            },
+            {
+                title: 'Clipboard',
+                url: '/docs/modules/clipboard/',
+            },
+            {
+                title: 'Syntax',
+                url: '/docs/modules/syntax/',
+            },
+        ],
+    },
+    {
+        title: 'Themes',
+        url: '/docs/themes/',
+    },
+];
+export default items;
+//# sourceMappingURL=docs.js.map

Some files were not shown because too many files changed in this diff