@@ -17,12 +17,17 @@ jobs:
1717 strategy :
1818 matrix :
1919 rust : [stable]
20+ env :
21+ # cargo hack does not use the default-members in Cargo.toml, so we restrict to those explicitly
22+ CARGO_HACK : cargo hack -p lsp-positions -p stack-graphs -p tree-sitter-stack-graphs --feature-powerset --exclude-features copious-debugging
2023
2124 steps :
2225 - name : Install Rust environment
2326 uses : hecrj/setup-rust-action@v1
2427 with :
2528 rust-version : ${{ matrix.rust }}
29+ - name : Install cargo-hack
30+ run : cargo install cargo-hack
2631 - name : Checkout code
2732 uses : actions/checkout@v3
2833 - name : Check formatting
@@ -36,28 +41,24 @@ jobs:
3641 key : ${{ runner.OS }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3742 restore-keys : |
3843 ${{ runner.OS }}-cargo-
44+ - name : Build library (all feature combinations)
45+ run : ${{ env.CARGO_HACK }} --no-dev-deps build
46+ - name : Run test suite (all feature combinations)
47+ run : ${{ env.CARGO_HACK }} test
48+ - name : Run test suite with all optimizations (default features)
49+ run : cargo test --release
3950 - name : Install cargo-valgrind
4051 run : |
4152 sudo apt-get update
4253 sudo apt-get install -y valgrind
4354 cargo install cargo-valgrind
44- - name : Build library
45- run : cargo build
55+ - name : Run test suite under valgrind (default features)
56+ # We only need to use valgrind to test the crates that have C bindings.
57+ run : cargo valgrind test -p stack-graphs
4658 - name : Ensure C headers are up to date
4759 run : |
4860 script/cbindgen
4961 test -z "$(git status --porcelain)"
50- - name : Run test suite
51- run : cargo test
52- - name : Run test suite under valgrind
53- # We only need to use valgrind to test the crates that have C bindings.
54- run : cargo valgrind test -p stack-graphs
55- - name : Run lsp-positions tests without tree-sitter
56- run : cargo test -p lsp-positions --no-default-features
57- - name : Run test suite with all features enabled
58- run : cargo test --all-features
59- - name : Run test suite with all optimizations
60- run : cargo test --release
6162
6263 test-init :
6364 needs : [test-rust]
@@ -112,6 +113,8 @@ jobs:
112113 uses : hecrj/setup-rust-action@v1
113114 with :
114115 rust-version : ${{ matrix.rust }}
116+ - name : Install cargo-hack
117+ run : cargo install cargo-hack
115118 - name : Cache dependencies
116119 uses : actions/cache@v3
117120 with :
@@ -123,10 +126,10 @@ jobs:
123126 ${{ runner.OS }}-cargo-
124127 - name : Checkout code
125128 uses : actions/checkout@v3
126- - name : Build
127- run : cargo build -p ${{ matrix.language }}
128- - name : Test
129- run : cargo test -p ${{ matrix.language }}
129+ - name : Build (all feature combinations)
130+ run : cargo hack -p ${{ matrix.language }} --feature-powerset build
131+ - name : Test (all features)
132+ run : cargo test -p ${{ matrix.language }} --all-features
130133
131134 test-cli :
132135 runs-on : ubuntu-latest
0 commit comments