Commit 69132045d28a7de60db79ce2340cb4f4899ac7e8

James DiGioia 2020-10-24T18:08:21

Migrate from TravisCI -> GitHub Actions (#2606) This moves the test suite from Travis -> GitHub Actions. The Workflow is essentially the same as what we had on Travis, but split into two jobs.

diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
new file mode 100644
index 0000000..0e07d03
--- /dev/null
+++ b/.github/workflows/test.yml
@@ -0,0 +1,46 @@
+name: CI
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    branches: [ master ]
+
+jobs:
+  tests:
+
+    runs-on: ubuntu-latest
+
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x, 14.x]
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Use Node.js ${{ matrix.node-version }}
+        uses: actions/setup-node@v1
+        with:
+          node-version: ${{ matrix.node-version }}
+      - run: npm ci
+      - run: npm test
+
+  build:
+
+    runs-on: ubuntu-latest
+
+    strategy:
+      matrix:
+        node-version: [10.x, 12.x, 14.x]
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Use Node.js ${{ matrix.node-version }}
+        uses: actions/setup-node@v1
+        with:
+          node-version: ${{ matrix.node-version }}
+      - run: npm ci
+      - run: npm run build
+      - run: |
+          git add --all && \
+          git diff-index --cached HEAD --stat --exit-code || \
+          (echo && echo "The above files changed because the build is not up to date." && echo "Please rebuild Prism." && exit 1)
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 1023859..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,30 +0,0 @@
-language: node_js
-node_js:
-- '10'
-- '12'
-- 'node'
-# Build all branches
-branches:
-  only:
-  - gh-pages
-  - /.*/
-before_install:
-- npm i -g npm@latest
-install:
-- npm ci
-before_script:
-# Rebuild Prism
-- npx gulp
-# Detect changes
-# First, we stage all changes and then detect if there is anything staged
-- git add --all && git diff-index --cached HEAD --stat --exit-code ||
-  (echo && echo "The above files changed because the build is not up to date." && echo "Please rebuild Prism." && exit 1)
-script: npm test
-deploy:
-  provider: npm
-  email: lea@verou.me
-  api_key:
-    secure: TjRcXEr7Y/9KRJ4EOEQbd2Ij8hxKj8c/yOpEROy2lTYv6QH9x46nFDgZEE3VHfp/nnBUYpC47dRaSxiUj8H5rtkMNCZrREZu1n1zahmzP6dI6kCj+H3GiY7yw/Jhdx3uvQZHwknW2TJ/YRsLeQsmMSG2HnJobY9Zn4REX5ccP2E=
-  on:
-    tags: true
-    repo: PrismJS/prism
diff --git a/README.md b/README.md
index 2478355..f5a4704 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 # [Prism](https://prismjs.com/)
 
-[![Build Status](https://travis-ci.org/PrismJS/prism.svg?branch=master)](https://travis-ci.org/PrismJS/prism)
+[![Build Status](https://github.com/PrismJS/prism/workflows/CI/badge.svg)](https://github.com/PrismJS/prism/actions)
 [![npm](https://img.shields.io/npm/dw/prismjs.svg)](https://www.npmjs.com/package/prismjs)
 
 Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/).
diff --git a/docs/index.html b/docs/index.html
index 31a9a46..7e64a15 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -52,7 +52,7 @@
 
     <section class="readme usertext">
         <article><h1><a href="https://prismjs.com/">Prism</a></h1>
-<p><a href="https://travis-ci.org/PrismJS/prism"><img src="https://travis-ci.org/PrismJS/prism.svg?branch=master" alt="Build Status"></a>
+<p><a href="https://github.com/PrismJS/prism/actions"><img src="https://github.com/PrismJS/prism/workflows/CI/badge.svg" alt="Build Status"></a>
 <a href="https://www.npmjs.com/package/prismjs"><img src="https://img.shields.io/npm/dw/prismjs.svg" alt="npm"></a></p>
 <p>Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from <a href="https://dabblet.com/">Dabblet</a>.</p>
 <p>You can learn more on <a href="https://prismjs.com/">prismjs.com</a>.</p>