|
| 1 | +# ******************************************************************************* |
| 2 | +# Copyright (c) 2025 Contributors to the Eclipse Foundation |
| 3 | +# |
| 4 | +# See the NOTICE file(s) distributed with this work for additional |
| 5 | +# information regarding copyright ownership. |
| 6 | +# |
| 7 | +# This program and the accompanying materials are made available under the |
| 8 | +# terms of the Apache License Version 2.0 which is available at |
| 9 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | +# |
| 11 | +# SPDX-License-Identifier: Apache-2.0 |
| 12 | +# ******************************************************************************* |
| 13 | +name: Format and Internal Tests of Utils |
| 14 | + |
| 15 | +on: |
| 16 | + pull_request: |
| 17 | + types: [opened, reopened, synchronize] |
| 18 | + |
| 19 | +jobs: |
| 20 | + lint: |
| 21 | + runs-on: ubuntu-latest |
| 22 | + steps: |
| 23 | + - name: Checkout repository |
| 24 | + uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - name: Set up Python |
| 27 | + uses: actions/setup-python@v5 |
| 28 | + with: |
| 29 | + python-version: '3.12' |
| 30 | + |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + python -m pip install --upgrade pip |
| 34 | + pip install -e ".[dev]" || true |
| 35 | +
|
| 36 | + - name: Check formatting with Ruff |
| 37 | + run: ruff check . |
| 38 | + |
| 39 | + test: |
| 40 | + runs-on: ubuntu-latest |
| 41 | + steps: |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@v4 |
| 44 | + |
| 45 | + - name: Setup Bazel |
| 46 | + uses: bazel-contrib/setup-bazel@0.15.0 |
| 47 | + with: |
| 48 | + bazelisk-version: 1.26.0 # newest LTS before 1 Jun 2025 |
| 49 | + |
| 50 | + - name: Install Rust (Cargo) |
| 51 | + uses: actions-rs/toolchain@v1 |
| 52 | + with: |
| 53 | + toolchain: stable |
| 54 | + profile: minimal |
| 55 | + components: cargo |
| 56 | + |
| 57 | + - name: Set up Python |
| 58 | + uses: actions/setup-python@v5 |
| 59 | + with: |
| 60 | + python-version: '3.12' |
| 61 | + |
| 62 | + - name: Install dependencies |
| 63 | + run: | |
| 64 | + python -m pip install --upgrade pip |
| 65 | + pip install -e ".[dev]" || true |
| 66 | +
|
| 67 | + - name: Run tests with pytest |
| 68 | + run: pytest tests -v |
0 commit comments