Require Ruff 0.16 and apply formatting #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build and Test | |
| on: | |
| push: | |
| pull_request: | |
| concurrency: | |
| group: build-${{ github.event.pull_request.number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| submodules: recursive | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.12" | |
| - name: Install Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install rips pytest pytest-cov "ruff>=0.16" taskmaestro==0.1.0 | |
| - name: Ruff check | |
| run: ruff check . | |
| - name: Ruff format check | |
| run: ruff format --check . | |
| - name: Install Linux runtime dependencies | |
| run: | | |
| sudo apt-get update --option="APT::Acquire::Retries=3" | |
| sudo apt-get install --option="APT::Acquire::Retries=3" -y \ | |
| libxkbcommon-x11-0 libgl1 libglu1-mesa libglfw3 libegl1 \ | |
| libxcb-cursor0 libxcb-icccm4 libxcb-image0 libxcb-keysyms1 \ | |
| libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xkb1 \ | |
| xvfb | |
| - name: Download ResInsight nightly build | |
| run: | | |
| curl -L -o ResInsight-nightly.zip \ | |
| "https://nightly.link/OPM/ResInsight/workflows/ResInsightWithCache/dev/ResInsight-Ubuntu%2024.04%20gcc.zip" | |
| unzip -q ResInsight-nightly.zip -d resinsight-nightly | |
| chmod +x resinsight-nightly/bin/ResInsight | |
| - name: Run tests | |
| env: | |
| RESINSIGHT_EXECUTABLE: ${{ github.workspace }}/resinsight-nightly/bin/ResInsight | |
| PYTHONPATH: ${{ github.workspace }} | |
| run: > | |
| xvfb-run --auto-servernum | |
| pytest tests/ -v | |
| --cov=taskmaestro_resinsight | |
| --cov-report=term | |
| --cov-report=xml | |
| - name: Upload coverage report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: coverage-xml | |
| path: coverage.xml |