diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000000..0e07d03419 --- /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 1023859023..0000000000 --- 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 2478355c9d..f5a470413f 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 31a9a46c6d..7e64a15db0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -52,7 +52,7 @@

Home

Prism

-

Build Status +

Build Status npm

Prism is a lightweight, robust, elegant syntax highlighting library. It's a spin-off project from Dabblet.

You can learn more on prismjs.com.