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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113
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>