From a6d698073f54753fb5fc3e639a2ff27c1d017418 Mon Sep 17 00:00:00 2001 From: Allen Downey Date: Wed, 15 May 2024 10:10:43 -0400 Subject: [PATCH] Test the examples directory --- .github/workflows/tests.yml | 36 ++++++++++++++++++++++++++++++++++++ Makefile | 5 +++-- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..975f3a75 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,36 @@ +name: tests + +on: + push: + branches: [master] + pull_request: + schedule: + # Run on the first of the month + - cron: "0 0 1 * *" + workflow_dispatch: + +jobs: + tests: + name: Tests (${{ matrix.os }}, Python ${{ matrix.python-version }}) + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + python-version: ["3.10"] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-dev.txt + + - name: Run tests + run: | + make tests diff --git a/Makefile b/Makefile index 4d980441..6fcc56e7 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ PROJECT_NAME = ModSimPy -PYTHON_VERSION = 3.8 +PYTHON_VERSION = 3.10 PYTHON_INTERPRETER = python @@ -29,4 +29,5 @@ clean: tests: - cd chapters; pytest --nbmake chap01.ipynb + cd chapters; pytest --nbmake chap*.ipynb + cd examples; pytest --nbmake *.ipynb