Skip to content

Commit cc7b6ea

Browse files
authored
Merge pull request #308 from gavinr/dependencies
Package maintenance
2 parents 04e8edb + 40405dc commit cc7b6ea

File tree

7 files changed

+886
-641
lines changed

7 files changed

+886
-641
lines changed

.github/workflows/main.yml

Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: CI
2+
on: [push, pull_request]
3+
env:
4+
NODE_VERSION: 16
5+
jobs:
6+
setup:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
matrix:
10+
os: [ubuntu-latest, windows-latest]
11+
steps:
12+
- name: Check out repository
13+
uses: actions/checkout@v3
14+
15+
- name: Set up Node
16+
uses: actions/setup-node@v3
17+
with:
18+
node-version: ${{ env.NODE_VERSION }}
19+
check-latest: true
20+
cache: npm
21+
22+
- name: Cache dependencies
23+
id: cache-dependencies
24+
uses: actions/cache@v3
25+
with:
26+
path: node_modules
27+
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
28+
29+
- name: Install dependencies
30+
if: steps.cache-dependencies.outputs.cache-hit != 'true'
31+
run: npm ci
32+
33+
- name: Cache setup
34+
uses: actions/cache@v3
35+
with:
36+
path: ./*
37+
key: ${{ runner.os }}-${{ github.sha }}-setup
38+
39+
build:
40+
needs: setup
41+
runs-on: ${{ matrix.os }}
42+
strategy:
43+
matrix:
44+
os: [ubuntu-latest, windows-latest]
45+
steps:
46+
- name: Restore setup
47+
uses: actions/cache@v3
48+
with:
49+
path: ./*
50+
key: ${{ runner.os }}-${{ github.sha }}-setup
51+
52+
- name: Set up Node
53+
uses: actions/setup-node@v3
54+
with:
55+
node-version: ${{ env.NODE_VERSION }}
56+
57+
- name: Build project
58+
run: npm run build
59+
60+
- name: Cache build
61+
uses: actions/cache@v3
62+
with:
63+
path: ./*
64+
key: ${{ runner.os }}-${{ github.sha }}-build
65+
66+
lint:
67+
needs: setup
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Restore setup
71+
uses: actions/cache@v3
72+
with:
73+
path: ./*
74+
key: ${{ runner.os }}-${{ github.sha }}-setup
75+
76+
- name: Set up Node
77+
uses: actions/setup-node@v3
78+
with:
79+
node-version: ${{ env.NODE_VERSION }}
80+
81+
- name: Run lint task
82+
run: npm run lint
83+
84+
test:
85+
needs: build
86+
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
87+
strategy:
88+
fail-fast: false
89+
matrix:
90+
include:
91+
- browser: Chrome1280x1024
92+
- browser: FirefoxTouch
93+
- browser: FirefoxNoTouch
94+
- browser: Edge
95+
os: windows-latest
96+
steps:
97+
- name: Restore build
98+
uses: actions/cache@v3
99+
with:
100+
path: ./*
101+
key: ${{ runner.os }}-${{ github.sha }}-build
102+
103+
- name: Set up Node
104+
uses: actions/setup-node@v3
105+
with:
106+
node-version: ${{ env.NODE_VERSION }}
107+
108+
- name: Run tests on ${{ matrix.browser }}
109+
run: npm test -- --browsers ${{ matrix.browser }}

.travis.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,11 @@
33
The Esri Leaflet Geocoder is a small series of API helpers and UI controls to interact with the ArcGIS Online geocoding services.
44

55
[![npm version][npm-img]][npm-url]
6-
[![build status][travis-img]][travis-url]
76
[![apache licensed](https://img.shields.io/badge/license-Apache-green.svg?style=flat-square)](https://raw.githubusercontent.com/Esri/esri-leaflet-geocoder/master/LICENSE)
87
[![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/esri-leaflet-geocoder/badge)](https://www.jsdelivr.com/package/npm/esri-leaflet-geocoder)
98

109
[npm-img]: https://img.shields.io/npm/v/esri-leaflet-geocoder.svg?style=flat-square
1110
[npm-url]: https://www.npmjs.com/package/esri-leaflet-geocoder
12-
[travis-img]: https://img.shields.io/travis/Esri/esri-leaflet-geocoder/master.svg?style=flat-square
13-
[travis-url]: https://travis-ci.org/Esri/esri-leaflet-geocoder
1411

1512
## Example
1613

karma.conf.js

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = function (config) {
77

88
// frameworks to use
99
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
10-
frameworks: ['mocha', 'chai-sinon'],
10+
frameworks: ['mocha', 'sinon-chai'],
1111

1212
// list of files / patterns to load in the browser
1313
files: [
@@ -48,13 +48,38 @@ module.exports = function (config) {
4848
// start these browsers
4949
// available browser launchers: https://npmjs.org/browse/keyword/karma-launcher
5050
browsers: [
51-
'Chrome'
52-
// 'ChromeCanary',
53-
// 'Firefox',
54-
// 'Safari',
55-
// 'PhantomJS'
51+
'Chrome1280x1024'
5652
],
5753

54+
customLaunchers: {
55+
Chrome1280x1024: {
56+
base: 'ChromeHeadless',
57+
// increased viewport is required for some tests (TODO fix tests)
58+
// https://github.com/Leaflet/Leaflet/issues/7113#issuecomment-619528577
59+
flags: ['--window-size=1280,1024']
60+
},
61+
FirefoxTouch: {
62+
base: 'FirefoxHeadless',
63+
prefs: {
64+
'dom.w3c_touch_events.enabled': 1
65+
}
66+
},
67+
FirefoxNoTouch: {
68+
base: 'FirefoxHeadless',
69+
prefs: {
70+
'dom.w3c_touch_events.enabled': 0
71+
}
72+
}
73+
},
74+
75+
concurrency: 1,
76+
77+
// If browser does not capture in given timeout [ms], kill it
78+
captureTimeout: 60000,
79+
80+
// Timeout for the client socket connection [ms].
81+
browserSocketTimeout: 30000,
82+
5883
// Continuous Integration mode
5984
// if true, Karma captures browsers, runs the tests and exits
6085
singleRun: true,

0 commit comments

Comments
 (0)