|
| 1 | +name: PySATL CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + |
| 12 | + runs-on: ubuntu-latest |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + python-version: ["3.10", "3.11", "3.12"] |
| 16 | + |
| 17 | + steps: |
| 18 | + - uses: actions/checkout@v4 |
| 19 | + - name: Set up Python ${{ matrix.python-version }} |
| 20 | + uses: actions/setup-python@v5 |
| 21 | + with: |
| 22 | + python-version: ${{ matrix.python-version }} |
| 23 | + |
| 24 | + - name: Display Python version |
| 25 | + run: python -c "import sys; print(sys.version)" |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + pip install -r requirements-dev.txt |
| 31 | +
|
| 32 | + - name: Run tests |
| 33 | + run: pytest --random-order |
| 34 | + |
| 35 | + - name: Tests with Coveralls |
| 36 | + if: (runner.os == 'Linux' && matrix.python-version == '3.12') |
| 37 | + run: | |
| 38 | + pytest --random-order --cov=stattest --cov-config=.coveragerc |
| 39 | +
|
| 40 | + - name: Coveralls |
| 41 | + if: (runner.os == 'Linux' && matrix.python-version == '3.12') |
| 42 | + env: |
| 43 | + COVERALLS_REPO_TOKEN: ${{ secrets.coverallsToken }} |
| 44 | + run: | |
| 45 | + # Allow failure for coveralls |
| 46 | + coveralls || true |
| 47 | +
|
| 48 | + - name: Check for repository changes |
| 49 | + run: | |
| 50 | + if [ -n "$(git status --porcelain)" ]; then |
| 51 | + echo "Repository is dirty, changes detected:" |
| 52 | + git status |
| 53 | + git diff |
| 54 | + exit 1 |
| 55 | + else |
| 56 | + echo "Repository is clean, no changes detected." |
| 57 | + fi |
| 58 | +
|
| 59 | + - name: Sort imports (isort) |
| 60 | + run: | |
| 61 | + isort --check . |
| 62 | +
|
| 63 | + - name: Run Ruff |
| 64 | + run: | |
| 65 | + ruff check --output-format=github |
| 66 | +
|
| 67 | + - name: Run Ruff format check |
| 68 | + run: | |
| 69 | + ruff format --check |
0 commit comments