-
Notifications
You must be signed in to change notification settings - Fork 4
76 lines (61 loc) · 1.83 KB
/
Copy pathci.yml
File metadata and controls
76 lines (61 loc) · 1.83 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: CI
on:
push:
branches: [main]
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
readme-sync-check:
name: README sync script check
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Sync npm README from root README
run: ./scripts/sync-npm-readme.sh
- name: Report README drift (non-blocking)
run: |
set -euxo pipefail
if ! git diff --quiet -- npm/tu/README.md; then
echo "::notice::npm/tu/README.md differs from generated README. Release workflow auto-syncs this before npm publish."
fi
lint-and-test:
name: Lint + Test
runs-on: ubuntu-latest
needs: [readme-sync-check]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- name: Cache Rust build
uses: Swatinem/rust-cache@v2
- name: Format check
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Cargo check
run: cargo check --workspace --all-targets --all-features
- name: Tests
run: cargo test --workspace --all-targets --all-features
npm-package-check:
name: npm package dry-run
runs-on: ubuntu-latest
needs: [readme-sync-check]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Validate npm package can be published
run: |
set -euxo pipefail
./scripts/sync-npm-version.sh
./scripts/sync-npm-readme.sh
cd npm/tu
npm pack --dry-run --ignore-scripts