when:
- event: ["push"]
branch: master
paths:
- knot2/**
- lexicons/**
- Cargo.toml
- Cargo.lock
- rust-toolchain.toml
- .tangled/workflows/rust-test-knot.yml
engine: microvm
image: nixos-large
dependencies:
- gcc
- gnumake
- cmake
- perl
- gawk
- gnused
- gnugrep
- findutils
- just
- git-lfs
- openssh
- go
- cargo-nextest
- git
- "github:nix-community/fenix/f6670530f53e69cc284f7aef818eb0f08fe81905#stable.minimalToolchain"
environment:
CARGO_HOME: /workspace/repo/.cache/cargo
GOCACHE: /workspace/repo/.cache/go-build
GOMODCACHE: /workspace/repo/.cache/go-mod
CARGO_INCREMENTAL: "0"
# cargo's built-in git client takes 10 minutes to clone jacquard here
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
CARGO_PROFILE_DEV_DEBUG: "0"
CARGO_PROFILE_TEST_DEBUG: "0"
RUST_BACKTRACE: "1"
# the vm's disk makes every fsync in the tests slow
TMPDIR: /dev/shm
KNOT_LFS_CONFORMANCE: "skip"
GIT_CONFIG_COUNT: "2"
GIT_CONFIG_KEY_0: "gc.autoDetach"
GIT_CONFIG_VALUE_0: "false"
GIT_CONFIG_KEY_1: "maintenance.auto"
GIT_CONFIG_VALUE_1: "false"
cache:
- key: cargo-knot
hash:
- Cargo.lock
fallback: true
when: always
paths:
- .cache/cargo/registry/index
- .cache/cargo/registry/cache
- target
- key: go
hash:
- go.sum
fallback: true
when: always
paths:
- .cache/go-build
- .cache/go-mod
steps:
- name: knot tests
command: |
ulimit -n "$(ulimit -Hn)" &&
cargo nextest run --locked --profile ci -p 'knot-*'
- name: knot instrumented tests
command: |
ulimit -n "$(ulimit -Hn)" &&
cd knot2 && just instrument-tests
- name: drop test executables before caching
command: |
find target/debug/deps -maxdepth 1 -type f -perm -u+x ! -name '*.so' -delete