-
Notifications
You must be signed in to change notification settings - Fork 7
48 lines (39 loc) · 1.2 KB
/
tests-unit.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Unit tests
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
permissions:
contents: read
id-token: write
pull-requests: write
env:
BOA_FORK_RPC_URL: "https://eth-mainnet.g.alchemy.com/${{ secrets.ALCHEMY_KEY }}"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install coverage
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
- name: Run project unit tests
run: |
coverage run -m pytest tests/unit --durations=0 --runslow
coverage report -m | tee coverage.txt
sed -i '1s/^/coverage: platform marker \n/' coverage.txt
coverage xml
- name: Create coverage comment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./coverage.txt
if: github.event_name == 'pull_request'