|
1 | | -name: planet_overlap CI |
| 1 | +name: CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ main, develop ] |
6 | 5 | pull_request: |
7 | | - branches: [ main ] |
8 | 6 |
|
9 | 7 | jobs: |
10 | 8 | build-and-test: |
11 | 9 | runs-on: ubuntu-latest |
12 | 10 |
|
| 11 | + strategy: |
| 12 | + matrix: |
| 13 | + python-version: ["3.10", "3.11", "3.12"] |
| 14 | + |
13 | 15 | steps: |
14 | | - # 1️⃣ Checkout repository |
15 | 16 | - name: Checkout repository |
16 | | - uses: actions/checkout@v3 |
| 17 | + uses: actions/checkout@v4 |
17 | 18 |
|
18 | | - # 2️⃣ Setup Python 3.10 |
19 | 19 | - name: Set up Python |
20 | | - uses: actions/setup-python@v4 |
| 20 | + uses: actions/setup-python@v5 |
21 | 21 | with: |
22 | | - python-version: "3.10" |
| 22 | + python-version: ${{ matrix.python-version }} |
23 | 23 |
|
24 | | - # 3️⃣ Install Poetry |
25 | | - - name: Install Poetry |
26 | | - run: | |
27 | | - curl -sSL https://install.python-poetry.org | python3 - |
28 | | - echo "$HOME/.local/bin" >> $GITHUB_PATH |
29 | | - poetry --version |
| 24 | + - name: Upgrade pip |
| 25 | + run: python -m pip install --upgrade pip |
30 | 26 |
|
31 | | - # 4️⃣ Install dependencies (including package) |
32 | | - - name: Install dependencies |
33 | | - run: | |
34 | | - poetry install |
| 27 | + - name: Install package + dev dependencies |
| 28 | + run: pip install -e .[dev] |
35 | 29 |
|
36 | | - # 5️⃣ Run linting |
37 | | - - name: Run linting |
38 | | - run: | |
39 | | - poetry run flake8 . --max-line-length=100 |
| 30 | + - name: Lint (flake8) |
| 31 | + run: flake8 src tests |
| 32 | + |
| 33 | + - name: Check formatting (black) |
| 34 | + run: black --check . |
| 35 | + |
| 36 | + - name: Type check (mypy) |
| 37 | + run: mypy src |
| 38 | + |
| 39 | + - name: Run tests with coverage |
| 40 | + run: pytest --cov=planet_overlap --cov-report=term-missing |
40 | 41 |
|
41 | | - # 6️⃣ Run tests |
42 | | - - name: Run tests |
| 42 | + - name: Build distribution |
43 | 43 | run: | |
44 | | - poetry run pytest tests --maxfail=1 --disable-warnings -q |
| 44 | + pip install build |
| 45 | + python -m build |
45 | 46 |
|
46 | | - # 7️⃣ Check memory usage for key test |
47 | | - - name: Memory profiling |
| 47 | + - name: Verify wheel installs |
48 | 48 | run: | |
49 | | - poetry run python -m memory_profiler tests/test_analysis.py |
| 49 | + pip install dist/*.whl |
| 50 | + python -c "import planet_overlap" |
0 commit comments