-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathci.sh
More file actions
executable file
·38 lines (29 loc) · 918 Bytes
/
ci.sh
File metadata and controls
executable file
·38 lines (29 loc) · 918 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
set -euo pipefail
# CI test script - runs the same tests as CI to catch issues before pushing
# Usage: ./ci.sh [--full]
#
# By default, runs only what CI runs: build C pikchr + cargo test --all --locked
# With --full, also runs fmt check and clippy
FULL=false
if [[ "${1:-}" == "--full" ]]; then
FULL=true
fi
echo "==> Running CI checks locally"
echo ""
if $FULL; then
echo "==> Checking formatting..."
cargo fmt --all -- --check
echo ""
echo "==> Running clippy..."
cargo clippy --all --all-targets -- -D warnings
echo ""
fi
echo "==> Building C pikchr (required for comparison tests)..."
# pikchr.c is pre-generated, just compile it directly
cc -O0 -g -Wall -Wextra -DPIKCHR_SHELL vendor/pikchr-c/pikchr.c -o vendor/pikchr-c/pikchr -lm
echo ""
echo "==> Running tests (cargo test --all --locked)..."
cargo test --all --locked
echo ""
echo "==> All CI checks passed!"