|
| 1 | +name: build |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - release** |
| 8 | + paths-ignore: |
| 9 | + - '**.md' |
| 10 | + - '**.rst' |
| 11 | + pull_request: |
| 12 | + paths-ignore: |
| 13 | + - '**.md' |
| 14 | + - '**.rst' |
| 15 | + |
| 16 | +jobs: |
| 17 | + build: |
| 18 | + runs-on: ${{ matrix.os }}-latest |
| 19 | + strategy: |
| 20 | + fail-fast: False |
| 21 | + matrix: |
| 22 | + os: [windows, ubuntu, macos] |
| 23 | + python-version: ["3.11"] |
| 24 | + include: |
| 25 | + - os: ubuntu |
| 26 | + python-version: "3.10" |
| 27 | + - os: ubuntu |
| 28 | + python-version: "3.9" |
| 29 | + - os: ubuntu |
| 30 | + python-version: "3.8" |
| 31 | + # Disabled for now. See https://github.com/projectmesa/mesa/issues/1253 |
| 32 | + #- os: ubuntu |
| 33 | + # python-version: 'pypy-3.8' |
| 34 | + |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + - name: Set up Python ${{ matrix.python-version }} |
| 38 | + uses: actions/setup-python@v4 |
| 39 | + with: |
| 40 | + python-version: ${{ matrix.python-version }} |
| 41 | + - uses: actions/cache@v3 |
| 42 | + with: |
| 43 | + path: ~/.cache/pip |
| 44 | + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('Pipfile.lock') }} |
| 45 | + - name: Install dependencies |
| 46 | + run: pip install wheel && pip install .[dev] |
| 47 | + # - name: Test with pytest |
| 48 | + # run: pytest --cov=mesa_viz_tornado tests/ --cov-report=xml |
| 49 | + - if: matrix.os == 'ubuntu' |
| 50 | + name: Codecov |
| 51 | + uses: codecov/codecov-action@v3 |
| 52 | + |
| 53 | + lint-ruff: |
| 54 | + runs-on: ubuntu-latest |
| 55 | + steps: |
| 56 | + - uses: actions/checkout@v4 |
| 57 | + - name: Set up Python 3.10 |
| 58 | + uses: actions/setup-python@v4 |
| 59 | + with: |
| 60 | + python-version: "3.10" |
| 61 | + - run: pip install ruff==0.0.254 |
| 62 | + - name: Lint with ruff |
| 63 | + # Include `--format=github` to enable automatic inline annotations. |
| 64 | + # Use settings from pyproject.toml. |
| 65 | + run: ruff . --format=github |
| 66 | + |
| 67 | + lint-black: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + steps: |
| 70 | + - uses: actions/checkout@v4 |
| 71 | + - name: Set up Python 3.10 |
| 72 | + uses: actions/setup-python@v4 |
| 73 | + with: |
| 74 | + python-version: "3.10" |
| 75 | + - run: pip install black |
| 76 | + - name: Lint with black |
| 77 | + run: black --check . |
0 commit comments