|
| 1 | +name: CI Pipeline |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: ["**"] |
| 6 | + pull_request: |
| 7 | + branches: ["**"] |
| 8 | + |
| 9 | +env: |
| 10 | + PYTHONPATH: "${{ github.workspace }}/python" |
| 11 | + MESHROOM_BATCHER_RESOURCES: "${{ github.workspace }}/resources" |
| 12 | + MESHROOM_BATCHER_PROVIDERS: "${{ github.workspace }}/python/providers" |
| 13 | + MESHROOM_PLUGINS_PATH: "${{ github.workspace }}/python/pipelineBatcher" |
| 14 | + |
| 15 | +jobs: |
| 16 | + # Stage BUILD - Build package |
| 17 | + build-package: |
| 18 | + name: Build Package |
| 19 | + runs-on: self-hosted |
| 20 | + steps: |
| 21 | + - name: Checkout repository |
| 22 | + uses: actions/checkout@v4 |
| 23 | + |
| 24 | + - name: Set up Python |
| 25 | + uses: actions/setup-python@v5 |
| 26 | + with: |
| 27 | + python-version: "3.11" |
| 28 | + |
| 29 | + - name: Install dependencies |
| 30 | + run: | |
| 31 | + python -m pip install --upgrade pip |
| 32 | + pip install pytest pytest-cov ruff black pylint |
| 33 | +
|
| 34 | + - name: Cache installed dependencies |
| 35 | + uses: actions/cache@v4 |
| 36 | + with: |
| 37 | + path: ~/.cache/pip |
| 38 | + key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml') }} |
| 39 | + restore-keys: | |
| 40 | + ${{ runner.os }}-pip- |
| 41 | +
|
| 42 | + # # Stage TEST - Launch python tests : disabled for now (need meshroom dependency) |
| 43 | + # test-pytest: |
| 44 | + # name: Test (pytest) |
| 45 | + # runs-on: self-hosted |
| 46 | + # needs: build-package |
| 47 | + # steps: |
| 48 | + # - name: Checkout repository |
| 49 | + # uses: actions/checkout@v4 |
| 50 | + |
| 51 | + # - name: Set up Python |
| 52 | + # uses: actions/setup-python@v5 |
| 53 | + # with: |
| 54 | + # python-version: "3.11" |
| 55 | + |
| 56 | + # - name: Install dependencies |
| 57 | + # run: | |
| 58 | + # python -m pip install --upgrade pip |
| 59 | + # pip install pytest pytest-cov |
| 60 | + |
| 61 | + # - name: Run tests |
| 62 | + # env: |
| 63 | + # PYTHONPATH: "${{ github.workspace }}/python" |
| 64 | + # run: | |
| 65 | + # python -m pytest \ |
| 66 | + # --cov=pipelineBatcher \ |
| 67 | + # --cov-config=${{ github.workspace }}/.coveragerc \ |
| 68 | + # --cov-report=xml:coverage.xml \ |
| 69 | + # --cov-report=html:htmlcov \ |
| 70 | + # --cov-report=term \ |
| 71 | + # -v \ |
| 72 | + # ${{ github.workspace }}/tests/ |
| 73 | + |
| 74 | + # - name: Upload coverage report |
| 75 | + # uses: actions/upload-artifact@v4 |
| 76 | + # if: always() |
| 77 | + # with: |
| 78 | + # name: coverage-report |
| 79 | + # path: | |
| 80 | + # coverage.xml |
| 81 | + # htmlcov/ |
| 82 | + # retention-days: 7 |
| 83 | + |
| 84 | + # Stage LINT - Check code quality |
| 85 | + lint-ruff: |
| 86 | + name: Lint (ruff) |
| 87 | + runs-on: self-hosted |
| 88 | + needs: build-package |
| 89 | + steps: |
| 90 | + - name: Checkout repository |
| 91 | + uses: actions/checkout@v4 |
| 92 | + |
| 93 | + - name: Set up Python |
| 94 | + uses: actions/setup-python@v5 |
| 95 | + with: |
| 96 | + python-version: "3.11" |
| 97 | + |
| 98 | + - name: Install ruff |
| 99 | + run: | |
| 100 | + python -m pip install --upgrade pip |
| 101 | + pip install ruff |
| 102 | +
|
| 103 | + - name: Run ruff |
| 104 | + run: | |
| 105 | + ruff check ${{ github.workspace }}/python/meshroomBatcher \ |
| 106 | + --config=${{ github.workspace }}/pyproject.toml |
0 commit comments