Merge pull request #26 from MBARIMike/main #245
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install | |
- name: Run pre-commit | |
run: poetry run pre-commit run --all-files | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: poetry install | |
- name: Set environment variables | |
run: | | |
echo "BASE_PATH=$HOME/auv_data" >> $GITHUB_ENV | |
echo "CAL_DIR=$HOME/auv_data" >> $GITHUB_ENV | |
- name: Download and unzip required data files | |
run: | | |
mkdir -p "$HOME/auv_data" | |
# Dorado389.tar.gz contains original log files of short dorado mission for testing: 2011.256.02 | |
wget -q --no-check-certificate -O "$HOME/auv_data/Dorado389.tar.gz" https://stoqs.mbari.org/auv_data/Dorado389.tar.gz | |
tar -xvf "$HOME/auv_data/Dorado389.tar.gz" -C "$HOME/auv_data" 2> /dev/null | |
# i2MAP.tar.gz contains original log files of i2MAP mission for testing: 2018.34.01 | |
wget -q --no-check-certificate -O "$HOME/auv_data/i2map.tar.gz" https://stoqs.mbari.org/auv_data/i2map.tar.gz | |
tar -xf "$HOME/auv_data/i2map.tar.gz" -C "$HOME/auv_data" 2> /dev/null | |
# i2map processing needs access to calibration files on an on-premisis server, unpack a subset of it here | |
wget -q --no-check-certificate -O "$HOME/auv_data/SBE-43.tar.gz" https://stoqs.mbari.org/auv_data/SBE-43.tar.gz | |
tar -xf "$HOME/auv_data/SBE-43.tar.gz" -C "$HOME/auv_data" 2> /dev/null | |
- name: Run tests | |
run: poetry run pytest |