|
| 1 | +--- |
| 2 | +name: CI |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + push: |
| 6 | + branches: [main, master] |
| 7 | + pull_request: |
| 8 | + branches: [main, master] |
| 9 | +jobs: |
| 10 | + ci: |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + os: [windows-latest, ubuntu-latest, macos-latest] |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + name: Run ossin on ${{ matrix.os }} |
| 17 | + timeout-minutes: 5 |
| 18 | + steps: |
| 19 | + - name: System Info |
| 20 | + shell: bash |
| 21 | + run: | |
| 22 | + if [[ ${{ matrix.os }} == "ubuntu-latest" ]]; then |
| 23 | + echo "The system is Linux." |
| 24 | + uname -a || true |
| 25 | + lsb_release -a || true |
| 26 | + gcc --version || true |
| 27 | + elif [[ ${{ matrix.os }} == "macos-latest" ]]; then |
| 28 | + echo "The system is macOS." |
| 29 | + sw_vers || true |
| 30 | + uname -a || true |
| 31 | + gcc --version || true |
| 32 | + elif [[ ${{ matrix.os }} == "windows-latest" ]]; then |
| 33 | + echo "The system is Windows (using a Unix-like environment)." |
| 34 | + systeminfo || true |
| 35 | + else |
| 36 | + echo "Unknown OS: $OS_TYPE" |
| 37 | + exit 1 |
| 38 | + fi |
| 39 | + - name: Environment Info |
| 40 | + run: | |
| 41 | + env || true |
| 42 | + - name: Checkout repository |
| 43 | + uses: actions/checkout@v5 |
| 44 | + - name: Set up Python |
| 45 | + uses: actions/setup-python@v5 |
| 46 | + with: |
| 47 | + python-version-file: '.python-version' |
| 48 | + - name: Setup uv |
| 49 | + id: setup-uv |
| 50 | + uses: astral-sh/setup-uv@v5 |
| 51 | + with: |
| 52 | + enable-cache: true |
| 53 | + - name: Restore cache |
| 54 | + if: steps.setup-uv.outputs.cache-hit == 'true' |
| 55 | + run: echo "Cache was restored" |
| 56 | + - name: Run CI |
| 57 | + if: ${{ matrix.os == 'ubuntu-latest' }} |
| 58 | + run: | |
| 59 | + uv run ruff check |
| 60 | + uv run ruff format |
| 61 | + uv run mypy |
| 62 | + uv run ty check |
| 63 | + uv run pyrefly check |
| 64 | + uv run pyright |
| 65 | + uv run vulture |
| 66 | + uv run validate-pyproject pyproject.toml |
| 67 | + - name: Run ossin |
| 68 | + run: | |
| 69 | + uv run ossin --version |
| 70 | + uv run ossin --no-color --format json |
| 71 | + uv run ossin --no-color --format panels |
| 72 | + uv run ossin --no-color --format table |
0 commit comments