|
1 | | -name: CI |
| 1 | +name: planet_overlap CI |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | | - branches: [ main ] |
| 5 | + branches: [ main, develop ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | 8 |
|
9 | 9 | jobs: |
10 | | - test: |
| 10 | + build-and-test: |
11 | 11 | runs-on: ubuntu-latest |
12 | 12 |
|
13 | 13 | steps: |
14 | | - - uses: actions/checkout@v3 |
15 | | - - uses: actions/setup-python@v4 |
16 | | - with: |
17 | | - python-version: 3.11 |
| 14 | + # Step 1: Checkout the repo |
| 15 | + - name: Checkout repository |
| 16 | + uses: actions/checkout@v3 |
| 17 | + |
| 18 | + # Step 2: Set up Python |
| 19 | + - name: Set up Python |
| 20 | + uses: actions/setup-python@v4 |
| 21 | + with: |
| 22 | + python-version: '3.10' |
| 23 | + |
| 24 | + # Step 3: Install Poetry |
| 25 | + - name: Install Poetry |
| 26 | + run: | |
| 27 | + curl -sSL https://install.python-poetry.org | python3 - |
| 28 | + export PATH="$HOME/.local/bin:$PATH" |
| 29 | + poetry --version |
| 30 | +
|
| 31 | + # Step 4: Install dependencies |
| 32 | + - name: Install dependencies |
| 33 | + run: | |
| 34 | + export PATH="$HOME/.local/bin:$PATH" |
| 35 | + poetry install --no-root |
18 | 36 |
|
19 | | - - name: Install Poetry |
20 | | - run: curl -sSL https://install.python-poetry.org | python3 - |
| 37 | + # Step 5: Run unit tests |
| 38 | + - name: Run tests |
| 39 | + run: | |
| 40 | + export PATH="$HOME/.local/bin:$PATH" |
| 41 | + poetry run pytest planet_overlap/tests --maxfail=1 --disable-warnings -q |
21 | 42 |
|
22 | | - - name: Install dependencies |
23 | | - run: poetry install |
| 43 | + # Step 6: Lint check |
| 44 | + - name: Lint code |
| 45 | + run: | |
| 46 | + export PATH="$HOME/.local/bin:$PATH" |
| 47 | + poetry run flake8 planet_overlap --max-line-length=100 |
24 | 48 |
|
25 | | - - name: Run tests |
26 | | - run: poetry run pytest --cov=planet_overlap --cov-report=xml |
| 49 | + # Step 7: Optional: Memory profiler test (if included in dev dependencies) |
| 50 | + - name: Memory profiling (optional) |
| 51 | + run: | |
| 52 | + export PATH="$HOME/.local/bin:$PATH" |
| 53 | + poetry run python -m memory_profiler |
0 commit comments