test #3
This file contains 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: build | |
on: | |
push: | |
branches: | |
- main | |
- release** | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
pull_request: | |
paths-ignore: | |
- '**.md' | |
- '**.rst' | |
# This will cancel previous run if a newer job that obsoletes the said previous | |
# run, is started. | |
# Based on https://github.com/zulip/zulip/commit/4a11642cee3c8aec976d305d51a86e60e5d70522 | |
concurrency: | |
group: "${{ github.workflow }}-${{ github.head_ref || github.run_id }}" | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }}-latest | |
# We need an explicit timeout because sometimes the batch_runner test never | |
# completes. | |
timeout-minutes: 6 | |
strategy: | |
fail-fast: False | |
matrix: | |
os: [windows, ubuntu, macos] | |
python-version: ["3.12"] | |
include: | |
- os: ubuntu | |
python-version: "3.11" | |
- os: ubuntu | |
python-version: "3.10" | |
- os: ubuntu | |
python-version: "3.9" | |
- os: ubuntu | |
python-version: "3.8" | |
# Disabled for now. See https://github.com/projectmesa/mesa/issues/1253 | |
#- os: ubuntu | |
# python-version: 'pypy-3.8' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/cache@v3 | |
with: | |
path: ${{ env.pythonLocation }} | |
key: ${{ runner.os }}-pip-${{ env.pythonLocation }}-${{ hashFiles('setup.py') }} | |
- name: todo | |
if: steps.cache.outputs.cache-hit != 'true' | |
run: pip install wheel && pip install click cookiecutter matplotlib mesa_viz_tornado~=0.1.0 networkx numpy pandas solara tqdm black ruff~=0.1.1 coverage pytest>=4.6 pytest-cov sphinx | |
- name: Install dependencies | |
run: pip install install --no-deps .[dev] | |
- name: Test with pytest | |
run: pytest --cov=mesa tests/ --cov-report=xml | |
- if: matrix.os == 'ubuntu' | |
name: Codecov | |
uses: codecov/codecov-action@v3 | |
lint-ruff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- run: pip install ruff~=0.1.1 # Update periodically | |
- name: Lint with ruff | |
# Include `--format=github` to enable automatic inline annotations. | |
# Use settings from pyproject.toml. | |
run: ruff . --output-format=github --extend-exclude 'mesa/cookiecutter-mesa/*' | |
lint-black: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- run: pip install black[jupyter] | |
- name: Lint with black | |
run: black --check --exclude=mesa/cookiecutter-mesa/* . |