-
Notifications
You must be signed in to change notification settings - Fork 27
105 lines (87 loc) · 2.42 KB
/
tests.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
105
name: Tests
on:
schedule:
- cron: '0 0 * * SUN'
push:
branches: [master]
pull_request:
branches: [master]
jobs:
validations:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/cache@v3
with:
path: |
.venv
.cache
.npm
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- run: git checkout ${{ env.BRANCH }}
- uses: actions/setup-node@v3
with:
node-version: '*'
check-latest: true
- run: |
npm ci --cache .npm --prefer-offline
npm install --global npm
npm install
- name: flowjs
run: npx flow check
- name: eslint
run: npx eslint --color .
- name: Build dist/ files
run: npm run prod:build
- name: web-ext
run: npx -c "web-ext lint --ignore-files=src/js/**"
jest-puppeteer:
name: Jest-Puppeteer Tests
needs: validations
strategy:
matrix:
# Use only lower and active versions
instance: ['11.0', '16.0', '17.0', '18.0']
browser: [chrome]
fail-fast: false
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/cache@v3
with:
path: |
.venv
.cache
.npm
node_modules
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Switch to current branch
run: git checkout ${{ env.BRANCH }}
- uses: actions/setup-node@v3
with:
node-version: '*'
check-latest: true
- name: Install dependencies
run: |
npm ci --cache .npm --prefer-offline
npm install --global npm
npm install
- name: Install browser firefox
run: npx @puppeteer/browsers install firefox
if: ${{ matrix.browser == 'firefox' }}
- name: Install browser chrome
run: npx @puppeteer/browsers install chrome
if: ${{ matrix.browser == 'chrome' }}
- name: Run test for ${{ matrix.instance }} (${{ matrix.browser }})
id: jest
run: npm run test
env:
ODOO_VERSION: "${{ matrix.instance }}"
PUPPETEER_BROWSER: "${{ matrix.browser }}"