name: CI on: push: pull_request: env: CARGO_TERM_COLOR: always jobs: test: name: Test and lint (host) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: components: clippy, rustfmt - uses: Swatinem/rust-cache@v2 - run: cargo fmt --all -- --check - run: cargo clippy --workspace --all-targets -- -D warnings - run: cargo test --workspace wasm: name: wasm32 check (browser bundle crates) runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@stable with: targets: wasm32-unknown-unknown - uses: Swatinem/rust-cache@v2 # Only the crates that go into the browser bundle. The root `improvise` # crate is the terminal binary and depends on crossterm, which does not # build for wasm — that is correct, not a gap (improvise-ywd). - name: improvise-core run: cargo check -p improvise-core --target wasm32-unknown-unknown - name: improvise-formula run: cargo check -p improvise-formula --target wasm32-unknown-unknown - name: improvise-protocol run: cargo check -p improvise-protocol --target wasm32-unknown-unknown - name: improvise-io run: cargo check -p improvise-io --target wasm32-unknown-unknown - name: improvise-command run: cargo check -p improvise-command --target wasm32-unknown-unknown # The browser client itself. This is the one crate for which a wasm # build is the *point* rather than a property worth keeping, so a # failure here is not a portability regression but a broken deliverable # (improvise-gsw). - name: improvise-wasm-client run: cargo check -p improvise-wasm-client --target wasm32-unknown-unknown # Not in the browser bundle yet — nothing depends on improvise-gp. Gated # anyway because it is a candidate (fitting a tree in the browser) and # staying wasm-clean is free now, expensive to retrofit (improvise-z5eg). - name: improvise-gp run: cargo check -p improvise-gp --target wasm32-unknown-unknown kb: name: Knowledge base consistency runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v27 # kb.pl is executable knowledge, so it gets checked like code: rules # must reject what they should, domains must close, and functional keys # must not carry conflicting values. See kb_report/0 in the file. - name: kb_consistent run: | nix shell nixpkgs#trealla --command tpl prolog-sessions/kb.pl \ -g "(kb_consistent -> halt(0) ; (kb_report, halt(1)))"