XDEFI-5454: setup geckoterminal token source (#1) #3
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: run tests and check coverage | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: checkout repo content | |
uses: actions/checkout@v2 # checkout the repository content | |
- name: setup python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' # install the python version needed | |
- name: install python packages | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: run pytest | |
id: test_step | |
run: pytest tests | |
- name: Fail workflow if tests were failed | |
if: ${{ steps.test_step.outcome == 'failure' }} | |
run: exit 1 | |
- name: run coverage | |
id: test_cov_step | |
run: | | |
coverage run -m pytest tests | |
coverage report -m | awk '/TOTAL/ {print ($4 > 70)}' | |
- name: Fail workflow if test coverage score is below threshold | |
if: ${{ steps.test_cov_step.outcome == 0 }} | |
run: exit 1 |