-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (56 loc) · 1.62 KB
/
ci.yml
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: CI Pipeline
on:
push:
branches:
- master
paths:
- 'gbrl/**' # Trigger on changes to files in the src directory
pull_request:
branches:
- master
workflow_dispatch:
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ['3.10']
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y lcov g++ gcc
- name: Set environment variable for coverage
run: echo "COVERAGE=1" >> $GITHUB_ENV
- name: Install Python dependencies and build the project with coverage
run: |
python -m pip install --upgrade pip
python -m pip install coverage
pip install .
- name: Run tests
run: |
coverage run --source=gbrl -m unittest discover tests
- name: Generate coverage report
run: |
coverage report
coverage xml
- name: Generate C++ coverage report
run: |
lcov --capture --directory . --output-file coverage.info
lcov --remove coverage.info '/usr/*' --output-file coverage.info
lcov --list coverage.info
- name: Upload coverage reports as artifacts
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: |
coverage.xml
coverage.info