diff --git a/.github/workflows/python-test.yml b/.github/workflows/python-test.yml new file mode 100644 index 00000000..a79db5d5 --- /dev/null +++ b/.github/workflows/python-test.yml @@ -0,0 +1,38 @@ +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.10 + uses: actions/setup-python@v3 + with: + python-version: '3.10' + - 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: | + conda env update --file micasense_conda_env.yml --name base + - name: Test with pytest + run: | + conda install pytest + pytest + diff --git a/micasense_conda_env.yml b/micasense_conda_env.yml index 2ce10af0..a23aca30 100644 --- a/micasense_conda_env.yml +++ b/micasense_conda_env.yml @@ -2,7 +2,7 @@ name: micasense channels: - conda-forge dependencies: - - python=3.7 + - python=3.10 - opencv=4.1 - numpy - jupyter