mirror of
https://github.com/jlengrand/leaflet-geosearch.git
synced 2026-03-10 08:31:26 +00:00
113 lines
2.9 KiB
YAML
113 lines
2.9 KiB
YAML
name: CI
|
|
|
|
on:
|
|
pull_request:
|
|
types: [opened, synchronize, reopened]
|
|
|
|
env:
|
|
NODE_VERSION: "12.x"
|
|
|
|
jobs:
|
|
setup:
|
|
name: Setup
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: "${{ env.NODE_VERSION }}"
|
|
|
|
- name: Cache node modules
|
|
id: cache
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
- name: Install Dependencies
|
|
if: steps.cache.outputs.cache-hit != 'true'
|
|
run: npm ci
|
|
|
|
eslint:
|
|
name: Eslint
|
|
runs-on: ubuntu-latest
|
|
needs: [setup]
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: "${{ env.NODE_VERSION }}"
|
|
|
|
- name: Fetch all branches
|
|
run: |
|
|
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
- name: ESLint
|
|
run: npm run ci:lint -- $(git diff --diff-filter d --name-only origin/${{ github.base_ref }}...HEAD -- '*.js' '*.ts' '*.tsx')
|
|
|
|
typescript:
|
|
name: Typescript
|
|
runs-on: ubuntu-latest
|
|
needs: [setup]
|
|
timeout-minutes: 5
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: "${{ env.NODE_VERSION }}"
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
- name: Typescript
|
|
run: npm run ci:tsc
|
|
|
|
tests:
|
|
name: Tests
|
|
runs-on: ubuntu-latest
|
|
needs: [setup]
|
|
timeout-minutes: 5
|
|
strategy:
|
|
matrix:
|
|
leaflet: ["1.6.0", "1.7.1", "1.8.0"]
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-node@v1
|
|
with:
|
|
node-version: "${{ env.NODE_VERSION }}"
|
|
|
|
- name: Cache node modules
|
|
uses: actions/cache@v1
|
|
with:
|
|
path: node_modules
|
|
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
|
|
|
|
- name: install specific leaflet version
|
|
run: npm install leaflet@${{ matrix.leaflet }}
|
|
|
|
- name: unit tests
|
|
run: npm run ci:test
|
|
env:
|
|
GATSBY_BING_API_KEY: ${{ secrets.BING_API_KEY }}
|
|
GATSBY_GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
|
GATSBY_LOCATIONIQ_API_KEY: ${{ secrets.LOCATIONIQ_API_KEY }}
|
|
GATSBY_OPENCAGE_API_KEY: ${{ secrets.OPENCAGE_API_KEY }}
|
|
GATSBY_HERE_API_KEY: ${{ secrets.HERE_API_KEY }}
|