| 1 |
name: linters |
| 2 |
|
| 3 |
on: |
| 4 |
push: |
| 5 |
branches: [ master ] |
| 6 |
|
| 7 |
pull_request: |
| 8 |
branches: [ master ] |
| 9 |
|
| 10 |
workflow_dispatch: |
| 11 |
|
| 12 |
|
| 13 |
jobs: |
| 14 |
linters: |
| 15 |
runs-on: ${{ matrix.os }} |
| 16 |
timeout-minutes: 15 |
| 17 |
strategy: |
| 18 |
matrix: |
| 19 |
os: [ ubuntu-latest, macos-13 ] |
| 20 |
python: [ '3.9', '3.10', '3.11', '3.12', '3.13' ] |
| 21 |
|
| 22 |
steps: |
| 23 |
- uses: actions/checkout@v4 |
| 24 |
|
| 25 |
- name: select Xcode version |
| 26 |
|
| 27 |
|
| 28 |
if: startsWith(matrix.os, 'macos-') |
| 29 |
run: | |
| 30 |
if [ -d /Applications/Xcode_15.3.app/Contents/Developer ]; then sudo xcode-select --switch /Applications/Xcode_15.3.app/Contents/Developer; fi |
| 31 |
clang++ --version |
| 32 |
g++ --version |
| 33 |
|
| 34 |
- uses: actions/setup-python@v5 |
| 35 |
with: |
| 36 |
python-version: ${{ matrix.python }} |
| 37 |
|
| 38 |
- name: Set up Python |
| 39 |
uses: actions/setup-python@v5 |
| 40 |
with: |
| 41 |
python-version: ${{ matrix.python }} |
| 42 |
|
| 43 |
- name: Work around arm64 support on MacOS |
| 44 |
|
| 45 |
if: matrix.os == 'macos-latest' |
| 46 |
run: sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/* |
| 47 |
|
| 48 |
- name: Install dependencies |
| 49 |
run: | |
| 50 |
python -m pip install --upgrade pip |
| 51 |
python -m pip install -r requirements.txt |
| 52 |
python -m pip install numpy |
| 53 |
|
| 54 |
- name: Build scalene |
| 55 |
run: pip -v install -e . |
| 56 |
|
| 57 |
- name: install test dependencies |
| 58 |
run: | |
| 59 |
python3 -m pip install mypy ruff |
| 60 |
python3 -m pip install . |
| 61 |
|
| 62 |
- name: Run linters |
| 63 |
run: | |
| 64 |
mypy scalene |
| 65 |
ruff check scalene |
| 66 |
|