-
Notifications
You must be signed in to change notification settings - Fork 222
90 lines (73 loc) · 2.52 KB
/
build.yml
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
name: Build
on:
push:
branches:
- '**' # Prevents builds on tag
jobs:
build:
runs-on: ubuntu-20.04
env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
BROWSERSLIST_IGNORE_OLD_DATA: true
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Use Node.js 16
uses: actions/setup-node@v3
with:
node-version: 16.x
- name: pnpm cache
uses: actions/cache@v3
with:
path: ./common/temp/pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('common/config/rush/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-
- name: Install
run: node common/scripts/install-run-rush.js install
- name: Build
run: node common/scripts/install-run-rush.js rebuild --verbose
- name: Test
run: node common/scripts/install-run-rush.js test --verbose
- 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
if: ${{ env.SAUCE_ACCESS_KEY != '' }}
working-directory: ./trackers/javascript-tracker
run: node ../../common/scripts/install-run-rushx.js test:e2e:sauce
- name: Pack
run: node common/scripts/install-run-rush.js publish -p --pack --include-all
- name: Upload packages
uses: actions/upload-artifact@v2
with:
name: packages
path: |
./common/temp/artifacts/packages/*
- name: Upload sp.js artifact
uses: actions/upload-artifact@v2
with:
name: sp.js
path: trackers/javascript-tracker/dist/sp.js
- name: Upload sp.lite.js artifact
uses: actions/upload-artifact@v2
with:
name: sp.lite.js
path: trackers/javascript-tracker/dist/sp.lite.js
- name: Upload plugins
uses: actions/upload-artifact@v2
with:
name: plugins.umd
path: |
./plugins/*/dist/*.umd.js
./plugins/*/dist/*.umd.js.map
./plugins/*/dist/*.umd.min.js
./plugins/*/dist/*.umd.min.js.map