|
1 | 1 | name: CI |
2 | | - |
3 | | -on: |
4 | | - push: |
5 | | - branches: |
6 | | - - main |
7 | | - pull_request: |
8 | | - branches: |
9 | | - - main |
10 | | - |
11 | | -permissions: |
12 | | - contents: read |
13 | | - |
14 | | -defaults: |
15 | | - run: |
16 | | - shell: bash |
17 | | - |
| 2 | +on: push |
18 | 3 | jobs: |
19 | | - check: |
| 4 | + cargo-test: |
20 | 5 | runs-on: ubuntu-latest |
21 | | - |
22 | 6 | steps: |
23 | 7 | - name: Checkout repository |
24 | 8 | uses: actions/checkout@v2 |
25 | | - |
| 9 | + - name: Set up Rust |
| 10 | + uses: moonrepo/setup-rust@v1.3 |
| 11 | + with: |
| 12 | + inherit-toolchain: true |
26 | 13 | - name: Set up Node |
27 | 14 | uses: actions/setup-node@v4 |
28 | 15 | with: |
29 | | - node-version: 24 |
30 | | - |
31 | | - - name: Set up pnpm |
32 | | - uses: pnpm/action-setup@v4 |
33 | | - |
| 16 | + node-version: '24' |
| 17 | + - name: Run cargo test |
| 18 | + run: cargo test -q |
| 19 | + - name: Run wasm-pack build and test |
| 20 | + working-directory: crates/wasm |
| 21 | + run: |- |
| 22 | + cargo install wasm-pack |
| 23 | + wasm-pack test --node |
| 24 | + javascript-check-and-test: |
| 25 | + runs-on: ubuntu-latest |
| 26 | + steps: |
| 27 | + - name: Checkout repository |
| 28 | + uses: actions/checkout@v2 |
34 | 29 | - name: Set up Rust |
35 | | - uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 30 | + uses: moonrepo/setup-rust@v1.3 |
36 | 31 | with: |
37 | | - toolchain: stable |
38 | | - target: wasm32-wasip1-threads |
39 | | - rustflags: "" |
40 | | - |
41 | | - - name: Cache cargo registry |
42 | | - uses: actions/cache@v4 |
43 | | - with: |
44 | | - path: ~/.cargo/registry |
45 | | - key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
46 | | - restore-keys: | |
47 | | - ${{ runner.os }}-cargo-registry- |
48 | | -
|
49 | | - - name: Cache cargo index |
50 | | - uses: actions/cache@v4 |
| 32 | + targets: wasm32-wasip1-threads |
| 33 | + inherit-toolchain: true |
| 34 | + - name: Set up Node |
| 35 | + uses: actions/setup-node@v4 |
51 | 36 | with: |
52 | | - path: ~/.cargo/git |
53 | | - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }} |
54 | | - restore-keys: | |
55 | | - ${{ runner.os }}-cargo-index- |
56 | | -
|
57 | | - - name: Cache cargo build |
58 | | - uses: actions/cache@v4 |
| 37 | + node-version: '24' |
| 38 | + - name: Set up pnpm |
| 39 | + uses: pnpm/action-setup@v4 |
59 | 40 | with: |
60 | | - path: target |
61 | | - key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} |
62 | | - restore-keys: | |
63 | | - ${{ runner.os }}-cargo-build-target- |
64 | | -
|
65 | | - - name: Run cargo test |
66 | | - run: cargo test |
67 | | - |
68 | | - - name: Install wasm-pack |
69 | | - run: cargo install wasm-pack |
70 | | - |
71 | | - - name: Run wasm tests |
72 | | - working-directory: crates/wasm |
73 | | - run: wasm-pack test --node |
74 | | - |
75 | | - - name: Install and Build Packages |
76 | | - run: pnpm i && pnpm build |
77 | | - |
78 | | - - name: Test For Packages Under Headless |
| 41 | + run_install: true |
| 42 | + - name: Run pnpm build packages |
| 43 | + run: pnpm build |
| 44 | + - name: Run biome format and lint check |
| 45 | + run: |- |
| 46 | + npx biome format |
| 47 | + npx biome lint |
| 48 | + - name: Test packages under headless |
79 | 49 | uses: coactions/setup-xvfb@v1 |
80 | 50 | with: |
81 | 51 | run: pnpm test |
| 52 | + codspeed-benchmark: |
| 53 | + runs-on: ubuntu-latest |
| 54 | + steps: |
| 55 | + - name: Checkout repository |
| 56 | + uses: actions/checkout@v2 |
| 57 | + - name: Set up Rust |
| 58 | + uses: moonrepo/setup-rust@v1.3 |
| 59 | + with: |
| 60 | + bins: cargo-codspeed |
| 61 | + inherit-toolchain: true |
| 62 | + - name: Set up Node |
| 63 | + uses: actions/setup-node@v4 |
| 64 | + with: |
| 65 | + node-version: '24' |
| 66 | + - name: Set up pnpm |
| 67 | + uses: pnpm/action-setup@v4 |
| 68 | + - name: Run CodSpeed build |
| 69 | + run: cargo codspeed build -m walltime |
| 70 | + - name: Run CodSpeed benchmark |
| 71 | + uses: CodSpeedHQ/action@v4 |
| 72 | + with: |
| 73 | + run: cargo codspeed run bench -m walltime |
| 74 | + token: ${{ secrets.CODSPEED_TOKEN }} |
| 75 | + mode: walltime |
0 commit comments