|
| 1 | +name: MSRV (1.85) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [develop] |
| 6 | + pull_request: |
| 7 | + |
| 8 | +concurrency: |
| 9 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 10 | + cancel-in-progress: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +jobs: |
| 16 | + lint: |
| 17 | + name: Lint |
| 18 | + runs-on: ubuntu-24.04 |
| 19 | + |
| 20 | + steps: |
| 21 | + - name: Checkout |
| 22 | + uses: actions/checkout@v6 |
| 23 | + with: |
| 24 | + fetch-depth: 0 |
| 25 | + |
| 26 | + - name: Install Rust toolchain |
| 27 | + uses: dtolnay/rust-toolchain@1.85.0 |
| 28 | + |
| 29 | + - name: Set up Node.js |
| 30 | + uses: actions/setup-node@v5 |
| 31 | + with: |
| 32 | + node-version: 24 |
| 33 | + |
| 34 | + - name: Set up Python |
| 35 | + uses: actions/setup-python@v6 |
| 36 | + with: |
| 37 | + python-version-file: pyproject.toml |
| 38 | + |
| 39 | + - name: Install Python dependencies |
| 40 | + run: pip install ".[dev]" |
| 41 | + |
| 42 | + - name: Install CodeQL |
| 43 | + id: setup-codeql |
| 44 | + uses: github/codeql-action/setup-codeql@v4.36.2 |
| 45 | + with: |
| 46 | + tools: linked |
| 47 | + |
| 48 | + - name: Setup CodeQL |
| 49 | + run: echo "$(dirname '${{ steps.setup-codeql.outputs.codeql-path }}')" >> "$GITHUB_PATH" |
| 50 | + |
| 51 | + - name: Restore cargo registry |
| 52 | + uses: actions/cache/restore@v5 |
| 53 | + with: |
| 54 | + path: | |
| 55 | + ~/.cargo/registry |
| 56 | + ~/.cargo/git |
| 57 | + key: cargo-deps-${{ hashFiles('Cargo.lock') }} |
| 58 | + restore-keys: cargo-deps- |
| 59 | + |
| 60 | + - name: Restore CodeQL caches |
| 61 | + id: codeql-cache |
| 62 | + uses: actions/cache/restore@v5 |
| 63 | + with: |
| 64 | + path: | |
| 65 | + contrib/codeql/.cache |
| 66 | + ~/.codeql |
| 67 | + key: codeql-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pkgs/**/*.rs', 'contrib/codeql/**/*.ql', 'contrib/codeql/**/*.qll', 'Cargo.lock') }} |
| 68 | + |
| 69 | + - name: Run linters |
| 70 | + run: python3 contrib/lint/all_lint.py |
| 71 | + |
| 72 | + - name: Save CodeQL caches |
| 73 | + if: success() && steps.codeql-cache.outputs.cache-hit != 'true' |
| 74 | + uses: actions/cache/save@v5 |
| 75 | + with: |
| 76 | + path: | |
| 77 | + contrib/codeql/.cache |
| 78 | + ~/.codeql |
| 79 | + key: codeql-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('pkgs/**/*.rs', 'contrib/codeql/**/*.ql', 'contrib/codeql/**/*.qll', 'Cargo.lock') }} |
| 80 | + |
| 81 | + - name: Check PR commit messages |
| 82 | + if: github.event_name == 'pull_request' |
| 83 | + run: > |
| 84 | + python3 contrib/lint/lint_unconv.py |
| 85 | + -r "${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}" |
| 86 | +
|
| 87 | + build: |
| 88 | + name: Build and test |
| 89 | + runs-on: ubuntu-24.04 |
| 90 | + |
| 91 | + steps: |
| 92 | + - name: Checkout |
| 93 | + uses: actions/checkout@v6 |
| 94 | + |
| 95 | + - name: Install Rust toolchain |
| 96 | + uses: dtolnay/rust-toolchain@1.85.0 |
| 97 | + |
| 98 | + - name: Restore cargo registry |
| 99 | + uses: actions/cache/restore@v5 |
| 100 | + with: |
| 101 | + path: | |
| 102 | + ~/.cargo/registry |
| 103 | + ~/.cargo/git |
| 104 | + key: cargo-deps-${{ hashFiles('Cargo.lock') }} |
| 105 | + restore-keys: cargo-deps- |
| 106 | + |
| 107 | + - name: Build workspace |
| 108 | + run: cargo build --workspace --features full,_internal |
| 109 | + |
| 110 | + - name: Test workspace |
| 111 | + run: cargo test --workspace --features full,_internal |
0 commit comments