forked from prebid/Prebid.js
-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (110 loc) · 3.14 KB
/
Copy pathtest.yml
File metadata and controls
119 lines (110 loc) · 3.14 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
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
117
118
119
name: Run tests
on:
push:
branches:
- master
- '*-legacy'
pull_request_target:
types: [opened, synchronize, reopened]
concurrency:
group: test-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
checkout:
name: "Check out source and install dependencies"
timeout-minutes: 2
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
run: npm ci
- name: Cache source
uses: actions/cache/save@v4
with:
path: .
key: source-${{ github.run_id }}
lint:
name: "Run linter"
needs: checkout
runs-on: ubuntu-latest
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Restore source
uses: actions/cache/restore@v4
with:
path: .
key: source-${{ github.run_id }}
fail-on-cache-miss: true
- name: lint
run: npx eslint
test-no-features:
name: "Unit tests (all features disabled)"
needs: checkout
uses: ./.github/workflows/run-unit-tests.yml
with:
build-cmd: npx gulp precompile-all-features-disabled
test-cmd: npx gulp test-all-features-disabled-nobuild
serialize: false
secrets:
BROWSERSTACK_USER_NAME: ${{ secrets.BROWSERSTACK_USER_NAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
test:
name: "Unit tests (all features enabled + coverage)"
needs: checkout
uses: ./.github/workflows/run-unit-tests.yml
with:
build-cmd: npx gulp precompile
test-cmd: npx gulp test-only-nobuild --browserstack
serialize: true
secrets:
BROWSERSTACK_USER_NAME: ${{ secrets.BROWSERSTACK_USER_NAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
test-e2e:
name: "End-to-end tests"
needs: checkout
runs-on: ubuntu-latest
concurrency:
# see test-chunk.yml for notes on concurrency groups
group: browserstack-${{ github.run_id }}
cancel-in-progress: false
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USER_NAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Restore source
uses: actions/cache/restore@v4
with:
path: .
key: source-${{ github.run_id }}
fail-on-cache-miss: true
- name: Run tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: npx gulp e2e-test
coveralls:
name: Update coveralls
needs: test
runs-on: ubuntu-latest
steps:
- name: Restore working directory
uses: actions/cache/restore@v4
with:
path: .
key: ${{ needs.test.outputs.wdir }}
fail-on-cache-miss: true
- name: Coveralls
uses: coverallsapp/github-action@v2