From 79b86b1aecf3881984e9e80300313b0727206924 Mon Sep 17 00:00:00 2001 From: Ewout ter Hoeven Date: Sun, 25 Aug 2024 16:07:36 +0200 Subject: [PATCH] CI: Add workflow to test gis models --- .github/workflows/test_gis_examples.yml | 61 +++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/test_gis_examples.yml diff --git a/.github/workflows/test_gis_examples.yml b/.github/workflows/test_gis_examples.yml new file mode 100644 index 000000000..b087832f5 --- /dev/null +++ b/.github/workflows/test_gis_examples.yml @@ -0,0 +1,61 @@ +name: Test example models + +on: + push: + paths: + - 'gis/**/*.py' # If a gis model is modified + - 'test_gis_examples.py' # If the gis test script is modified + - '.github/workflows/test_gis_examples.yml' # If this workflow is modified + pull_request: + paths: + - 'gis/**/*.py' + - 'test_gis_examples.py' + - '.github/workflows/test_gis_examples.yml' + workflow_dispatch: + schedule: + - cron: '0 6 * * 1' # Monday at 6:00 UTC + +jobs: + # build-stable: + # runs-on: ubuntu-latest + # steps: + # - uses: actions/checkout@v4 + # - name: Set up Python + # uses: actions/setup-python@v5 + # with: + # python-version: "3.12" + # - name: Install dependencies + # run: pip install mesa pytest + # - name: Test with pytest + # run: pytest -rA -Werror test_examples.py + + build-pre: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + run: | + pip install mesa mesa-geo --pre + pip install pytest + - name: Test with pytest + run: pytest -rA -Werror test_examples.py + + build-main: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Install dependencies + run: | + pip install pytest + pip install -U git+https://github.com/projectmesa/mesa@main#egg=mesa + pip install -U git+https://github.com/projectmesa/mesa-geo@main#egg=mesa-geo + - name: Test with pytest + run: pytest -rA -Werror test_gis_examples.py