Skip to content

Add breach data model and sync command #1890

Add breach data model and sync command

Add breach data model and sync command #1890

name: Unit tests
on:
push:
branches:
- 'main'
pull_request:
jobs:
test-js:
runs-on: ubuntu-20.04
# NB: this workflow fails on Ubuntu 22.04 (AKA ubuntu-latest) because the
# browsers are installed from Ubuntu Snaps, and on 22.04 there's currently
# an issue where FF lacks access to auto-create a profile, so it hangs.
# However, 20.04 is long-term support (LTS) until 2025: https://wiki.ubuntu.com/Releases
steps:
- name: "Install framebuffer (xvfb), Firefox and Chromium"
run: |
sudo apt-get update
sudo apt-get install chromium-browser firefox xvfb
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
- name: "Install JS dependencies"
run: npm ci
- name: "Run JS tests"
run: xvfb-run npm test
test-python:
runs-on: ubuntu-20.04 # For consistency with above
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.9" # matches current Python in production
- name: "Run Python tests (on Docker)"
run: |
make clean test-image
CONTAINER_ID=$(docker ps -alq)
docker cp $CONTAINER_ID:/app/python_coverage .
- name: Store coverage as an artifact
uses: actions/upload-artifact@v3
with:
name: coverage-results
path: python_coverage
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v3
with:
# A CodeCov token is normally NOT needed for public repos, but this workaround is suggested here:
# https://community.codecov.com/t/upload-issues-unable-to-locate-build-via-github-actions-api/3954/18
token: ${{ secrets.CODECOV_TOKEN }}
files: python_coverage/coverage.xml
fail_ci_if_error: false # optional (default = false)
verbose: true # optional (default = false)