|
5 | 5 | branches: [main] |
6 | 6 | pull_request: |
7 | 7 | branches: [main] |
| 8 | + workflow_dispatch: |
| 9 | + |
| 10 | +concurrency: |
| 11 | + group: ci-${{ github.ref }} |
| 12 | + cancel-in-progress: true |
8 | 13 |
|
9 | 14 | jobs: |
10 | 15 | test: |
11 | 16 | runs-on: ubuntu-latest |
12 | 17 | strategy: |
| 18 | + fail-fast: false |
13 | 19 | matrix: |
14 | 20 | python-version: ["3.10", "3.11", "3.12"] |
15 | | - |
16 | 21 | steps: |
17 | 22 | - uses: actions/checkout@v4 |
18 | 23 |
|
19 | | - - name: Install uv |
20 | | - uses: astral-sh/setup-uv@v4 |
21 | | - |
22 | | - - name: Set up Python ${{ matrix.python-version }} |
23 | | - run: uv python install ${{ matrix.python-version }} |
| 24 | + - name: Set up uv |
| 25 | + uses: astral-sh/setup-uv@v5 |
| 26 | + with: |
| 27 | + enable-cache: true |
| 28 | + python-version: ${{ matrix.python-version }} |
24 | 29 |
|
25 | 30 | - name: Install dependencies |
26 | | - run: uv sync --all-extras |
| 31 | + run: uv sync --all-extras --dev |
| 32 | + |
| 33 | + - name: Ruff lint |
| 34 | + run: uv run ruff check . |
27 | 35 |
|
28 | | - - name: Lint |
29 | | - run: uv run ruff check src/ tests/ |
| 36 | + - name: Ruff format check |
| 37 | + run: uv run ruff format --check . |
30 | 38 |
|
31 | | - - name: Test |
32 | | - run: uv run pytest tests/ -v --cov=mj_viser --cov-report=term-missing |
| 39 | + - name: Pytest |
| 40 | + run: | |
| 41 | + if [ -d tests ]; then |
| 42 | + uv run pytest tests/ -v |
| 43 | + else |
| 44 | + echo "No tests/ directory; skipping pytest." |
| 45 | + fi |
| 46 | +
|
| 47 | + notify-robot-code: |
| 48 | + needs: test |
| 49 | + if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 50 | + runs-on: ubuntu-latest |
| 51 | + steps: |
| 52 | + - name: Dispatch integration run |
| 53 | + uses: peter-evans/repository-dispatch@v3 |
| 54 | + with: |
| 55 | + token: ${{ secrets.ROBOT_CODE_DISPATCH_TOKEN }} |
| 56 | + repository: personalrobotics/robot-code |
| 57 | + event-type: sibling-updated |
| 58 | + client-payload: '{"repo":"${{ github.event.repository.name }}","sha":"${{ github.sha }}"}' |
0 commit comments