Skip to content

Commit

Permalink
Add GitHub Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Courroux committed Feb 5, 2024
1 parent dfc8ac0 commit 283ad48
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Build and run Python unit tests

on: push
permissions:
contents: read
jobs:
test-linux:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v3
with:
python-version: '3.8'
- name: Add system deps and exiftool
run: |
sudo apt-get update
sudo apt-get install libzbar0 make perl
wget https://cpan.metacpan.org/authors/id/E/EX/EXIFTOOL/Image-ExifTool-12.76.tar.gz
tar -xzf Image-ExifTool-12.76.tar.gz
pushd Image-ExifTool-12.76/
perl Makefile.PL
make test
sudo make install
popd
- name: Add conda to system path
run: |
# $CONDA is an environment variable pointing to the root of the miniconda directory
echo $CONDA/bin >> $GITHUB_PATH
- name: Install dependencies
run: |
source "$CONDA/etc/profile.d/conda.sh"
hash -r
conda config --set always_yes yes --set changeps1 no
conda update -q conda
conda update -n base conda
conda info -a
conda env create -f micasense_conda_env.yml
conda activate micasense
- name: Test with pytest
run: |
source "$CONDA/etc/profile.d/conda.sh"
conda activate micasense
git lfs pull
pytest --junit-xml=test-results.xml
6 changes: 3 additions & 3 deletions micasense_conda_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: micasense
channels:
- conda-forge
dependencies:
- python=3.7
- opencv=4.1
- python=3.8
- opencv=4.8
- numpy
- jupyter
- matplotlib
Expand All @@ -23,6 +23,6 @@ dependencies:
- pip:
- pyzbar
- mapboxgl
- git+https://github.com/smarnach/pyexiftool.git#egg=pyexiftoolpy
- pyexiftool
- jenkspy
- rawpy

0 comments on commit 283ad48

Please sign in to comment.