diff --git a/.eslintrc b/.eslintrc index c68cda8..d4bb3ed 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,5 +8,16 @@ "no-prototype-builtins": 1, "no-caller": 1, "indent": [2, 4, { "SwitchCase": 1, "VariableDeclarator": 1, "outerIIFEBody": 1 }] + }, + "env": { + "node": true, + "mocha": true, + "amd": true + }, + "globals": { + "L": true, + "sinon": true, + "chai": true, + "happen": true } } \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ec48c89 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,55 @@ +name: CI + +on: + pull_request: + push: + branches: + - master + release: + types: + - created + schedule: + - cron: '0 2 * * *' + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: 12 + cache: 'npm' + - run: npm ci + - run: npm run lint + + test: + runs-on: ubuntu-latest + strategy: + matrix: + node: [ '12', '14', '16' ] + name: Node ${{ matrix.node }} unit test + steps: + - uses: actions/checkout@v2 + - name: Setup node + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + cache: 'npm' + - run: npm ci + - run: npm install leaflet togeojson --no-save + - run: npm test + + publish: + needs: [lint, test] + runs-on: ubuntu-latest + if: ${{ github.event_name == 'release' && github.event.action == 'created' }} + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-node@v1 + with: + node-version: 12 + - uses: JS-DevTools/npm-publish@v1 + with: + token: ${{ secrets.NPM_TOKEN }} \ No newline at end of file diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 70960e3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,19 +0,0 @@ -language: node_js -node_js: - - "9" - - "8" - - "6" - - "4" - -sudo: false - -cache: - directories: - - node_modules - -install: - - npm install - - npm install leaflet@^1.2.0 togeojson@^0.16.0 --no-save - -script: - - "npm test" diff --git a/README.md b/README.md index 2598484..eb23259 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,18 @@ Check out the [demo](http://makinacorpus.github.io/Leaflet.FileLayer/) ! For GPX and KML files, it currently depends on [Tom MacWright's togeojson.js](https://github.com/tmcw/togeojson). -[![Build Status](https://travis-ci.org/makinacorpus/Leaflet.FileLayer.png?branch=master)](https://travis-ci.org/makinacorpus/Leaflet.FileLayer) +![Build Status](https://github.com/makinacorpus/Leaflet.FileLayer/actions/workflows/ci.yml/badge.svg) Install ----- In order to use this plugin in your app you can either: * install it via your favorite package manager: - * `npm i leaflet-filelayer` - * `bower install git://github.com:makinacorpus/Leaflet.FileLayer.git` + +```shell +npm i leaflet-filelayer +bower install git://github.com:makinacorpus/Leaflet.FileLayer.git +``` + * download the repository and import the `leaflet.filelayer.js` file in your app. Dependencies and compatibilities @@ -118,7 +122,7 @@ Changelog Authors ------- -[![Makina Corpus](http://depot.makina-corpus.org/public/logo.gif)](http://makinacorpus.com) +[![Makina Corpus](https://github.com/makinacorpus.png)](https://www.makina-corpus.com) Contributions diff --git a/dev/index.html b/dev/index.html index a09a840..cc6be95 100644 --- a/dev/index.html +++ b/dev/index.html @@ -5,7 +5,7 @@ - +