Tests #197
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }}" |