|
| 1 | +name: Lint |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - main |
| 8 | + |
| 9 | +concurrency: |
| 10 | + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} |
| 11 | + cancel-in-progress: true |
| 12 | + |
| 13 | +# Least-privilege: these jobs only read the repo (checkout + build + lint). |
| 14 | +permissions: |
| 15 | + contents: read |
| 16 | + |
| 17 | +env: |
| 18 | + CARGO_TERM_COLOR: always |
| 19 | + |
| 20 | +jobs: |
| 21 | + # lgj-abi path-deps ndarray and lance-graph-contract (crates/lance-graph-contract |
| 22 | + # in the AdaWorldAPI/lance-graph sibling), and optionally (feature `ogar-classview`, |
| 23 | + # off by default) ogar-class-view in the AdaWorldAPI/OGAR sibling. Cargo resolves |
| 24 | + # the full dependency graph — including inactive optional path deps — so all three |
| 25 | + # siblings must exist on disk even though only two are compiled into the default |
| 26 | + # build. Checked out under the runner's top-level workspace, sibling to this repo's |
| 27 | + # own checkout, exactly as `../../../<repo>` from native/lgj-abi/Cargo.toml expects |
| 28 | + # (matches AdaWorldAPI/lance-graph's own .github/workflows/style.yml pattern). |
| 29 | + format: |
| 30 | + runs-on: ubuntu-latest |
| 31 | + timeout-minutes: 15 |
| 32 | + defaults: |
| 33 | + run: |
| 34 | + working-directory: lance-graph-java/native/lgj-abi |
| 35 | + steps: |
| 36 | + - uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + path: lance-graph-java |
| 39 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 40 | + with: |
| 41 | + # `defaults.run.working-directory` applies to `run:` steps only, NOT |
| 42 | + # to action steps: this action executes from GITHUB_WORKSPACE, where |
| 43 | + # the checkout is a subdirectory and no toolchain file is visible. It |
| 44 | + # would silently fall back to `stable` instead of the pin. `rust-src-dir` |
| 45 | + # is the input that points it at the crate — which is also where |
| 46 | + # `rust-toolchain.toml` lives, beside `.cargo/config.toml`. |
| 47 | + rust-src-dir: lance-graph-java/native/lgj-abi |
| 48 | + # The baseline goes HERE, not in a `CARGO_BUILD_RUSTFLAGS` env var. |
| 49 | + # This action exports `RUSTFLAGS` from its own `rustflags` input |
| 50 | + # (default `-D warnings`), and `RUSTFLAGS` overrides |
| 51 | + # `build.rustflags` — which is what `CARGO_BUILD_RUSTFLAGS` sets, so a |
| 52 | + # baseline put there is silently discarded. The first run proved it: |
| 53 | + # the crate's own SIGILL-guard test was reached with no target-cpu at |
| 54 | + # all. The action's default is kept alongside the baseline, not |
| 55 | + # replaced. |
| 56 | + # |
| 57 | + # v3 rather than the crate's own v4: `.cargo/config.toml` pins AVX-512 |
| 58 | + # because the production artifact is built for one known host, and |
| 59 | + # GitHub-hosted runners do not guarantee it. That file names v3 as the |
| 60 | + # remedy for a machine without AVX-512, and AVX2 is what |
| 61 | + # `the_x86_64_build_has_a_vector_baseline` requires — so this |
| 62 | + # retargets the gate rather than weakening it. |
| 63 | + rustflags: -D warnings -Ctarget-cpu=x86-64-v3 |
| 64 | + # No `toolchain:` input — the action reads `rust-toolchain.toml`, so the |
| 65 | + # pinned version lives in exactly ONE place. |
| 66 | + components: rustfmt, clippy |
| 67 | + - name: Check formatting (lgj-abi) |
| 68 | + run: cargo fmt -- --check |
| 69 | + |
| 70 | + clippy: |
| 71 | + runs-on: ubuntu-latest |
| 72 | + timeout-minutes: 30 |
| 73 | + defaults: |
| 74 | + run: |
| 75 | + working-directory: lance-graph-java/native/lgj-abi |
| 76 | + steps: |
| 77 | + - uses: actions/checkout@v4 |
| 78 | + with: |
| 79 | + path: lance-graph-java |
| 80 | + - name: Checkout AdaWorldAPI/ndarray (sibling dependency) |
| 81 | + uses: actions/checkout@v4 |
| 82 | + with: |
| 83 | + repository: AdaWorldAPI/ndarray |
| 84 | + path: ndarray |
| 85 | + - name: Checkout AdaWorldAPI/lance-graph (sibling dependency, lance-graph-contract) |
| 86 | + uses: actions/checkout@v4 |
| 87 | + with: |
| 88 | + repository: AdaWorldAPI/lance-graph |
| 89 | + path: lance-graph |
| 90 | + - name: Checkout AdaWorldAPI/OGAR (sibling dependency, optional ogar-classview feature) |
| 91 | + uses: actions/checkout@v4 |
| 92 | + with: |
| 93 | + repository: AdaWorldAPI/OGAR |
| 94 | + path: OGAR |
| 95 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 96 | + with: |
| 97 | + # `defaults.run.working-directory` applies to `run:` steps only, NOT |
| 98 | + # to action steps: this action executes from GITHUB_WORKSPACE, where |
| 99 | + # the checkout is a subdirectory and no toolchain file is visible. It |
| 100 | + # would silently fall back to `stable` instead of the pin. `rust-src-dir` |
| 101 | + # is the input that points it at the crate — which is also where |
| 102 | + # `rust-toolchain.toml` lives, beside `.cargo/config.toml`. |
| 103 | + rust-src-dir: lance-graph-java/native/lgj-abi |
| 104 | + # The baseline goes HERE, not in a `CARGO_BUILD_RUSTFLAGS` env var. |
| 105 | + # This action exports `RUSTFLAGS` from its own `rustflags` input |
| 106 | + # (default `-D warnings`), and `RUSTFLAGS` overrides |
| 107 | + # `build.rustflags` — which is what `CARGO_BUILD_RUSTFLAGS` sets, so a |
| 108 | + # baseline put there is silently discarded. The first run proved it: |
| 109 | + # the crate's own SIGILL-guard test was reached with no target-cpu at |
| 110 | + # all. The action's default is kept alongside the baseline, not |
| 111 | + # replaced. |
| 112 | + # |
| 113 | + # v3 rather than the crate's own v4: `.cargo/config.toml` pins AVX-512 |
| 114 | + # because the production artifact is built for one known host, and |
| 115 | + # GitHub-hosted runners do not guarantee it. That file names v3 as the |
| 116 | + # remedy for a machine without AVX-512, and AVX2 is what |
| 117 | + # `the_x86_64_build_has_a_vector_baseline` requires — so this |
| 118 | + # retargets the gate rather than weakening it. |
| 119 | + rustflags: -D warnings -Ctarget-cpu=x86-64-v3 |
| 120 | + components: rustfmt, clippy |
| 121 | + - uses: Swatinem/rust-cache@v2 |
| 122 | + with: |
| 123 | + workspaces: lance-graph-java/native/lgj-abi |
| 124 | + - name: Clippy lgj-abi |
| 125 | + run: cargo clippy --all-targets -- -D warnings |
| 126 | + |
| 127 | + rust-test: |
| 128 | + runs-on: ubuntu-latest |
| 129 | + timeout-minutes: 30 |
| 130 | + defaults: |
| 131 | + run: |
| 132 | + working-directory: lance-graph-java/native/lgj-abi |
| 133 | + steps: |
| 134 | + - uses: actions/checkout@v4 |
| 135 | + with: |
| 136 | + path: lance-graph-java |
| 137 | + - name: Checkout AdaWorldAPI/ndarray (sibling dependency) |
| 138 | + uses: actions/checkout@v4 |
| 139 | + with: |
| 140 | + repository: AdaWorldAPI/ndarray |
| 141 | + path: ndarray |
| 142 | + - name: Checkout AdaWorldAPI/lance-graph (sibling dependency, lance-graph-contract) |
| 143 | + uses: actions/checkout@v4 |
| 144 | + with: |
| 145 | + repository: AdaWorldAPI/lance-graph |
| 146 | + path: lance-graph |
| 147 | + - name: Checkout AdaWorldAPI/OGAR (sibling dependency, optional ogar-classview feature) |
| 148 | + uses: actions/checkout@v4 |
| 149 | + with: |
| 150 | + repository: AdaWorldAPI/OGAR |
| 151 | + path: OGAR |
| 152 | + - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 153 | + with: |
| 154 | + # `defaults.run.working-directory` applies to `run:` steps only, NOT |
| 155 | + # to action steps: this action executes from GITHUB_WORKSPACE, where |
| 156 | + # the checkout is a subdirectory and no toolchain file is visible. It |
| 157 | + # would silently fall back to `stable` instead of the pin. `rust-src-dir` |
| 158 | + # is the input that points it at the crate — which is also where |
| 159 | + # `rust-toolchain.toml` lives, beside `.cargo/config.toml`. |
| 160 | + rust-src-dir: lance-graph-java/native/lgj-abi |
| 161 | + # The baseline goes HERE, not in a `CARGO_BUILD_RUSTFLAGS` env var. |
| 162 | + # This action exports `RUSTFLAGS` from its own `rustflags` input |
| 163 | + # (default `-D warnings`), and `RUSTFLAGS` overrides |
| 164 | + # `build.rustflags` — which is what `CARGO_BUILD_RUSTFLAGS` sets, so a |
| 165 | + # baseline put there is silently discarded. The first run proved it: |
| 166 | + # the crate's own SIGILL-guard test was reached with no target-cpu at |
| 167 | + # all. The action's default is kept alongside the baseline, not |
| 168 | + # replaced. |
| 169 | + # |
| 170 | + # v3 rather than the crate's own v4: `.cargo/config.toml` pins AVX-512 |
| 171 | + # because the production artifact is built for one known host, and |
| 172 | + # GitHub-hosted runners do not guarantee it. That file names v3 as the |
| 173 | + # remedy for a machine without AVX-512, and AVX2 is what |
| 174 | + # `the_x86_64_build_has_a_vector_baseline` requires — so this |
| 175 | + # retargets the gate rather than weakening it. |
| 176 | + rustflags: -D warnings -Ctarget-cpu=x86-64-v3 |
| 177 | + components: rustfmt, clippy |
| 178 | + - uses: Swatinem/rust-cache@v2 |
| 179 | + with: |
| 180 | + workspaces: lance-graph-java/native/lgj-abi |
| 181 | + # Runs every #[test] in lgj-abi, including tests/g11_contract_import_fence.rs |
| 182 | + # — the fence CLAUDE.md's "Enforcement" section names as structural: it walks |
| 183 | + # src/ and rejects any `lance_graph_contract::` module outside the four-name |
| 184 | + # allowlist. Per this repo's own history, "G11 was prose until 2026-09-03" |
| 185 | + # because nothing ran the test that enforces it; this job is what runs it. |
| 186 | + - name: Test lgj-abi |
| 187 | + run: cargo test --all-targets |
0 commit comments