forked from snowplow/snowplow-javascript-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
76 lines (59 loc) · 1.64 KB
/
Copy pathbuild.yml
File metadata and controls
76 lines (59 loc) · 1.64 KB
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
name: Build
on:
push:
branches:
- 'master'
pull_request:
jobs:
build:
runs-on: ubuntu-20.04
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Use Node.js 12
uses: actions/setup-node@v1
with:
node-version: 12.x
- name: npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: ${{ runner.os }}-node-
- name: Core npm ci
working-directory: ./core
run: npm ci
- name: Build core
working-directory: ./core
run: npm run build
- name: Test core
working-directory: ./core
run: npm run test
- name: Tracker npm ci
run: npm ci
- name: Build tracker
run: npm run build
- name: Test tracker
run: npm run test:unit
- name: Block Concurrent Executions of E2E Tests
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
uses: softprops/turnstyle@v1
with:
poll-interval-seconds: 20
same-branch-only: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Add Host for Saucelabs Tunnel
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
run: echo "127.0.0.1 snowplow-js-tracker.local" | sudo tee -a /etc/hosts
- name: Run End to End Tests
run: npm run test:e2e:sauce
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
- name: Upload sp.js artifact
uses: actions/upload-artifact@v2
with:
name: sp.js
path: dist/sp.js