Skip to content

Commit afa8959

Browse files
Feature/python workflow (#11)
* try adding python workflow * add test deps * install torch cpu only * fix url typo * add python badge --------- Co-authored-by: Nathan Hughes <[email protected]>
1 parent 5fdaed4 commit afa8959

File tree

3 files changed

+38
-6
lines changed

3 files changed

+38
-6
lines changed

.github/workflows/cmake.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
---
22
# based on https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
3-
name: "ubuntu-latest: Build and Test"
3+
name: 'ubuntu-latest: Build and Test'
44
on: [push]
55
jobs:
66
build:
77
runs-on: ubuntu-latest
88
steps:
9-
# checkout the code
9+
# checkout the code
1010
- uses: actions/checkout@v4
11-
# setup package dependencies
11+
# setup package dependencies
1212
- name: Dependencies
1313
run: |
1414
sudo apt install libgtest-dev libeigen3-dev nlohmann-json3-dev libzmq3-dev python3-dev
15-
# configure repo
15+
# configure repo
1616
- name: Configure
1717
run: |
1818
cmake -B ${{github.workspace}}/build \
1919
-DCMAKE_BUILD_TYPE=Release \
2020
-DSPARK_DSG_BUILD_TESTS=ON \
2121
-DSPARK_DSG_BUILD_PYTHON=ON \
2222
-DSPARK_DSG_BUILD_EXAMPLES=ON
23-
# build repo
23+
# build repo
2424
- name: Build
2525
run: cmake --build ${{github.workspace}}/build --config Release
26-
# run unit tests
26+
# run unit tests
2727
- name: Test
2828
working-directory: ${{github.workspace}}/build
2929
run: ctest -C Release

.github/workflows/python.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
name: 'python: Build and Test'
4+
on: [push]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ['3.8', '3.10']
11+
steps:
12+
# checkout the code
13+
- uses: actions/checkout@v4
14+
# setup python
15+
- name: Setup Python ${{ matrix.python-version }}
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: ${{ matrix.python-version }}
19+
# install required deps
20+
- name: Dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
sudo apt install libgtest-dev libeigen3-dev nlohmann-json3-dev libzmq3-dev python3-dev
24+
# build and install code
25+
- name: Install
26+
run: python -m pip install ${{github.workspace}}
27+
- name: Test
28+
run: |
29+
pip install torch --index-url https://download.pytorch.org/whl/cpu
30+
pip install pytest networkx torch_geometric
31+
pytest ${{github.workspace}}/python/tests

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[![ubuntu-latest: Build and Test](https://github.com/MIT-SPARK/Spark-DSG/actions/workflows/cmake.yaml/badge.svg)](https://github.com/MIT-SPARK/Spark-DSG/actions/workflows/cmake.yaml)
22
[![ROS Noetic: Build and Test](https://github.com/MIT-SPARK/Spark-DSG/actions/workflows/catkin.yaml/badge.svg)](https://github.com/MIT-SPARK/Spark-DSG/actions/workflows/catkin.yaml)
3+
[![python: Build and Test](https://github.com/MIT-SPARK/Spark-DSG/actions/workflows/python.yaml/badge.svg)](https://github.com/MIT-SPARK/Spark-DSG/actions/workflows/python.yaml)
34

45
## Spark-DSG
56

0 commit comments

Comments
 (0)