Skip to content

Commit

Permalink
Feature/python workflow (#11)
Browse files Browse the repository at this point in the history
* try adding python workflow

* add test deps

* install torch cpu only

* fix url typo

* add python badge

---------

Co-authored-by: Nathan Hughes <[email protected]>
  • Loading branch information
nathanhhughes and nathanhhughes authored Jul 19, 2024
1 parent 5fdaed4 commit afa8959
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/cmake.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
---
# based on https://github.com/actions/starter-workflows/blob/main/ci/cmake-single-platform.yml
name: "ubuntu-latest: Build and Test"
name: 'ubuntu-latest: Build and Test'
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
# checkout the code
# checkout the code
- uses: actions/checkout@v4
# setup package dependencies
# setup package dependencies
- name: Dependencies
run: |
sudo apt install libgtest-dev libeigen3-dev nlohmann-json3-dev libzmq3-dev python3-dev
# configure repo
# configure repo
- name: Configure
run: |
cmake -B ${{github.workspace}}/build \
-DCMAKE_BUILD_TYPE=Release \
-DSPARK_DSG_BUILD_TESTS=ON \
-DSPARK_DSG_BUILD_PYTHON=ON \
-DSPARK_DSG_BUILD_EXAMPLES=ON
# build repo
# build repo
- name: Build
run: cmake --build ${{github.workspace}}/build --config Release
# run unit tests
# run unit tests
- name: Test
working-directory: ${{github.workspace}}/build
run: ctest -C Release
31 changes: 31 additions & 0 deletions .github/workflows/python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: 'python: Build and Test'
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.8', '3.10']
steps:
# checkout the code
- uses: actions/checkout@v4
# setup python
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
# install required deps
- name: Dependencies
run: |
python -m pip install --upgrade pip
sudo apt install libgtest-dev libeigen3-dev nlohmann-json3-dev libzmq3-dev python3-dev
# build and install code
- name: Install
run: python -m pip install ${{github.workspace}}
- name: Test
run: |
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install pytest networkx torch_geometric
pytest ${{github.workspace}}/python/tests
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[![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)
[![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)
[![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)

## Spark-DSG

Expand Down

0 comments on commit afa8959

Please sign in to comment.