-
Notifications
You must be signed in to change notification settings - Fork 57
78 lines (73 loc) · 1.93 KB
/
build_lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: build
on:
push:
branches:
- main
- release**
paths-ignore:
- '**.md'
- '**.rst'
pull_request:
paths-ignore:
- '**.md'
- '**.rst'
jobs:
build:
runs-on: ${{ matrix.os }}-latest
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@v5
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }}
- name: Install dependencies
run: pip install wheel && pip install .[dev]
- name: Test with pytest
run: pytest --cov=mesa_geo 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@v5
with:
python-version: "3.12"
- run: pip install ruff==0.1.5
- name: Lint with ruff
# Use settings from pyproject.toml.
run: ruff .
lint-black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install black[jupyter]
- name: Lint with black
run: black --check .