Skip to content

Update JS dependencies #2

Update JS dependencies

Update JS dependencies #2

# This is a scheduled workflow to keep hardcoded JS dependencies up to date
name: Update JS dependencies
on:
schedule:
# Runs at 00:00 UTC on the 2nd January of every year
- cron: '0 0 2 1 *'
# Allows you to run this workflow manually
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Update JS dependencies
run: python .github/workflows/update_js_dependencies.py
- name: Get cached Python packages
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools wheel
python -m pip install --upgrade . pytest-xdist pytest-playwright
python -m playwright install chromium --with-deps
- name: Run HTML tests
run: python -m pytest -v -n auto test/test_html.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
commit-message: "chore: update js dependencies"
title: "chore: update js dependencies"
branch: chore-js-dependencies
delete-branch: true
author: GitHub <[email protected]>
body: |
Check generated HTML report for any regressions [here][1].
[1]: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}
- name: Generate mock report
run: |
python -c 'from test.test_output_engine import TestOutputEngine; \
from cve_bin_tool.output_engine.html import output_html; \
output_html(TestOutputEngine.MOCK_OUTPUT, None, "", "", "", 3, 3, 0, None, None, open("test.html", "w"))'
- name: Upload mock report
uses: actions/upload-artifact@v3
with:
name: HTML report
path: test.html