-
Notifications
You must be signed in to change notification settings - Fork 178
104 lines (93 loc) · 3.19 KB
/
tests-karma-dashboard.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Dashboard Integration Tests
on:
push:
# Only run if dashboard-related files changed.
paths:
- 'babel.config.cjs'
- 'karma-dashboard.config.cjs'
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.ts'
- 'packages/**/*.tsx'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
branches:
- main
- release/*
pull_request:
# Only run if dashboard-related files changed.
paths:
- 'babel.config.cjs'
- 'karma-dashboard.config.cjs'
- 'webpack.config.cjs'
- 'webpack.config.test.cjs'
- 'packages/**/*.js'
- 'packages/**/*.ts'
- 'packages/**/*.tsx'
- '**/package.json'
- 'package-lock.json'
- '__static__/**'
permissions:
contents: read
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the (target) branch name.
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
karma:
name: Karma
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde
with:
disable-file-monitoring: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
codecov.io:443
fonts.googleapis.com:443
fonts.gstatic.com:443
github.com:443
registry.npmjs.org:443
storage.googleapis.com:443
uploader.codecov.io:443
www.gravatar.com:443
54.185.253.63:443
34.104.35.123:443
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Setup Node
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
with:
node-version-file: '.nvmrc'
cache: npm
# TODO: Remove need for `npm install puppeteer`.
- name: Install dependencies
run: |
npm ci
npm install puppeteer
env:
PUPPETEER_PRODUCT: chrome
# FIXME: https://github.com/googleforcreators/web-stories-wp/issues/4364
- name: Increase max number of file watchers
run: echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- name: Get Chromium executable path
id: chromium_path
run: |
CHROMIUM=$(node -p "const puppeteer = require('puppeteer'); puppeteer.executablePath();")
echo "chromium_path=${CHROMIUM}" >> $GITHUB_ENV
- name: Run integration tests
run: npm run test:karma:dashboard -- --headless --viewport=1600:1000 --coverage || npm run test:karma:dashboard:retry-failed -- --headless --viewport=1600:1000
env:
DISABLE_ERROR_BOUNDARIES: true
- name: Upload code coverage report
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673
with:
file: build/logs/karma-coverage/dashboard/lcov.info
flags: karmatests
token: ${{ secrets.CODECOV_TOKEN }}