-
Notifications
You must be signed in to change notification settings - Fork 118
81 lines (70 loc) · 2.47 KB
/
build.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
69
70
71
72
73
74
75
76
77
78
79
80
81
name: build
on: [pull_request, workflow_dispatch]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, macos-13, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
exclude:
# Exclude the combination of macOS-latest and Python 3.7 as arm64 doesn't support Python 3.7
- os: macos-latest
python-version: '3.7'
steps:
# Check out the repository code
- uses: actions/checkout@v4
# Set up the specified Python version
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# Install dependencies
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install pytest-cov
# Run tests with pytest and generate coverage report
- name: Test with pytest
run: |
pytest --cov=./ --cov-report=xml
# Additional steps only for ubuntu-latest and Python 3.10
# Upload the coverage report as an artifact
- name: Save coverage report
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: ./coverage.xml
# Install development dependencies
- name: Install dev dependencies
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
pip install -e .[develop]
# Run Pytype for type checking
- name: Pytype
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
pytype panda_gym
# Check code style with black and isort
- name: Check codestyle
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
black -l 127 --check panda_gym test
isort -l 127 --profile black --check panda_gym test
# Build documentation
- name: Make docs
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
run: |
make html
# Upload coverage to Codecov
- name: Upload coverage to Codecov
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'
uses: codecov/codecov-action@v4
with:
files: ./coverage.xml
fail_ci_if_error: true
name: codecov-umbrella
verbose: true
token: ${{ secrets.CODECOV_TOKEN }} # required