Merge pull request #141 from yaal-coop/copy-record #187
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: Check coverage | |
on: | |
pull_request: | |
branches: | |
- production | |
- main | |
push: | |
branches: | |
- production | |
- main | |
jobs: | |
compare-coverage: | |
name: Compare with previous coverage | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup git | |
uses: actions/checkout@v3 | |
- name: Get the git branch | |
uses: actions/checkout@v3 | |
with: | |
ref: main # TODO: dynamically get the branch against which the PR will be merged? | |
- name: Setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.11 | |
- name: Install python dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r web/requirements.app.txt | |
pip install -r web/requirements.dev.txt | |
pip install diff-cover | |
- name: Run unit tests with coverage | |
run: pytest --cov --cov-report=xml | |
- name: Check that the edited lines are all covered | |
run: diff-cover coverage.xml --fail-under=100 |