From a20fd7ca5111d0dc326a22466bf20c2d3bca2ff3 Mon Sep 17 00:00:00 2001 From: Sebastien Courroux Date: Mon, 5 Feb 2024 13:50:56 +0100 Subject: [PATCH] Add GitHub Actions --- .github/workflows/python-test.yml | 43 +++++++++++++++++++++++++++++++ micasense_conda_env.yml | 6 ++--- 2 files changed, 46 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/python-test.yml diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 00000000..b8426d1b --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,43 @@ +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: | + pytest diff --git a/micasense_conda_env.yml b/micasense_conda_env.yml index 2ce10af0..845e1f77 100644 --- a/micasense_conda_env.yml +++ b/micasense_conda_env.yml @@ -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 @@ -23,6 +23,6 @@ dependencies: - pip: - pyzbar - mapboxgl - - git+https://github.com/smarnach/pyexiftool.git#egg=pyexiftoolpy + - pyexiftool - jenkspy - rawpy