Skip to content

Add Unit Test Github Action Workflow #2

Add Unit Test Github Action Workflow

Add Unit Test Github Action Workflow #2

Workflow file for this run

# This workflow will install Python dependencies, build and run tests on the python versions in the matrix.
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: T-route Unit Test
on:
push:
branches: [ "master", "development"]
pull_request:
branches: [ "master", "development"]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Display Python version
run: python -c "import sys; print(sys.version)"
- name: Install dependencies
run: |
sudo apt-add-repository universe
sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install build-essential -y
sudo apt-get install aptitude -y
sudo apt-get install gfortran libudunits2-dev udunits-bin -y
sudo apt-get install libstdc++-10-dev libgfortran-10-dev glibc-source openmpi-bin openmpi-common libopenmpi-dev libopenmpi3 libgtk-3-bin libgtk-3-common libgtk-3-dev -y
sudo apt-get install netcdf-bin libnetcdf-dev libnetcdff-dev libnetcdf-c++4 libnetcdf-c++4-dev -y
python -m pip install --upgrade pip
pip3 install wheel dask pyproj fiona bmipy opencv-contrib-python-headless pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Install t-route
run: |
./compiler.sh no-e
- name: T-Route Pytests
run: |
pytest src/troute-config