forked from heremaps/harp.gl
-
Notifications
You must be signed in to change notification settings - Fork 6
116 lines (112 loc) · 3.33 KB
/
ci.yaml
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
114
115
116
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- '*'
env:
nodeTestTimeout: 4000
browserTestTimeout: 8000
DETECT_CHROMEDRIVER_VERSION: true
HARP_NO_HARD_SOURCE_CACHE: true
jobs:
test:
name: Test on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
node_version: [14]
os: [ubuntu-latest,macOS-latest,windows-latest]
fail-fast: true
steps:
- name: Reset git settings (Windows)
# Global git config on windows has autocrlf enabled.
# This breaks lot of checks, including eslint.
run: git config --global core.autocrlf false
if: matrix.os == 'windows-latest'
- uses: actions/checkout@v1
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
name: Yarn cache
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ runner.os }}-${{ matrix.node_version }}-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
yarn-${{ runner.os }}-${{ matrix.node_version }}-
yarn-${{ runner.os }}-
- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Pretest
run: yarn run pre-test
shell: bash
- name: Test Coverage
run: yarn test-cov
shell: bash
if: matrix.os != 'windows-latest'
- name: Publish Coverage (Linux)
run: |
bash <(curl -s https://codecov.io/bash) -f coverage/**/*.info
shell: bash
if: matrix.os == 'ubuntu-latest'
- name: Save Coverage Report (Linux)
uses: actions/upload-artifact@master
with:
name: coverage-report
path: coverage
if: matrix.os == 'ubuntu-latest'
- name: Build test bundle
run: |
set -ex
yarn run build-tests
shell: bash
- name: Tests on Chrome (Windows)
run: |
yarn karma-headless
shell: bash
if: matrix.os == 'windows-latest'
- name: Tests on Firefox (Windows)
run: |
yarn karma-headless-firefox
if: matrix.os == 'windows-latest'
- name: Tests on Chrome (Linux)
run: |
set -ex
yarn --frozen-lockfile
google-chrome --version
whereis google-chrome
yarn karma-headless
shell: bash
if: matrix.os == 'ubuntu-latest'
- name: Tests on Firefox (Linux)
run: |
set -ex
firefox --version
whereis firefox
yarn karma-headless-firefox
shell: bash
if: matrix.os == 'ubuntu-latest'
- name: Test Packages
run: |
./scripts/test-npm-packages.sh
shell: bash
if: matrix.os == 'ubuntu-latest'
- name: Build bundle
run: yarn run build-bundle
shell: bash
- name: Build examples
run: yarn run build-examples
shell: bash
- name: Generate doc
run: yarn run typedoc
shell: bash
# typedoc doesn't work on windows -> https://github.com/unstubbable/typedoc-plugin-monorepo/pull/1
if: matrix.os != 'windows-latest'