Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ppwwyyxx committed Oct 6, 2023
1 parent ed7f73d commit b6d408f
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
47 changes: 47 additions & 0 deletions .github/workflows/unittest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: UnitTest

on:
- push
- pull_request
- workflow_call

jobs:
test:
name: Test on ${{ matrix.os }}, ${{ matrix.install_from }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest] #, windows-latest, macos-latest]
install_from: [make, cmake]

steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.x"

- name: Cache files
uses: actions/cache@v3
with:
path: |
example-data/
key: ${{ runner.os }}-20231096

- name: Install dependency
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install libeigen3-dev libjpeg-dev

- name: Build with make
if: matrix.install_from == 'make'
run:
make -j -C src
cp src/image-stitching ./

- name: Build with cmake
if: matrix.install_from == 'cmake'
run:
mkdir build && cmake -B build && make -C build
cp build/src/image-stitching ./

- name: Run Unittests
run: python src/run_test.py
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ Debug
cmake_install.cmake
src/cmake_install.cmake
.vs/

example-data
example-data.tgz
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,13 @@ On Ubuntu, install dependencies by: `sudo apt install build-essential sed cmake
#### Linux / OSX / WSL (bash on windows)
Use cmake (a good default to try):
```
$ mkdir build && cd build && cmake .. && make
$ mkdir build && cmake -B build && make -C build
# Binary will be found at ./build/src/image-stitching
```
or, use make (more customizable. You can modify Makefile when you run into problems.):
```
$ make -C src
# Binary will be found at ./src/image-stitching
```
The default clang on OSX doesn't contain openmp support.
You may need gcc or different clang. See [#16](https://github.com/ppwwyyxx/OpenPano/issues/16).
Expand Down

0 comments on commit b6d408f

Please sign in to comment.