forked from usnistgov/AFL-agent
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.3 KB
/
tests.yml
File metadata and controls
45 lines (37 loc) · 1.3 KB
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
name: Run Tests
# TODO: remove the add-docker branch before merging to main
on:
push:
branches: [ 'main', 'add-docker' ]
pull_request:
branches: [ '*' ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.11','3.12','3.13']
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install graphviz
run: |
sudo apt-get update
sudo apt-get install -y graphviz graphviz-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[dev,mlmodels]"
- name: Run tests
run: |
pytest tests/ --cov=AFL.double_agent --cov-report=xml --cov-report=term
- name: Create Coverage Summary
if: matrix.python-version == '3.11'
run: |
COVERAGE=$(python -c "import xml.etree.ElementTree as ET; print(round(float(ET.parse('coverage.xml').getroot().get('line-rate')) * 100))")
echo "::notice title=Code Coverage::Total coverage is $COVERAGE%"
echo "## Test Coverage Summary" >> $GITHUB_STEP_SUMMARY
echo "Total coverage: **$COVERAGE%**" >> $GITHUB_STEP_SUMMARY