|
6 | 6 | - main |
7 | 7 | pull_request: |
8 | 8 | types: [opened, synchronize] |
9 | | - # Allow manual triggering |
10 | | - workflow_dispatch: |
11 | 9 |
|
12 | 10 | jobs: |
13 | | - benchmark: |
14 | | - name: Run tests and benchmarks |
| 11 | + build: |
15 | 12 | runs-on: ubuntu-latest |
16 | 13 |
|
17 | 14 | steps: |
18 | | - - name: Checkout repository |
19 | | - uses: actions/checkout@v4 |
20 | | - with: |
21 | | - fetch-depth: 1 |
| 15 | + - uses: actions/checkout@v1 |
22 | 16 |
|
23 | | - - uses: jetli/wasm-pack-action@v0.4.0 |
| 17 | + - name: Cache cargo registry |
| 18 | + uses: actions/cache@v1 |
24 | 19 | with: |
25 | | - version: "latest" |
| 20 | + path: ~/.cargo/registry |
| 21 | + key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} |
26 | 22 |
|
27 | | - - name: Install just |
28 | | - uses: extractions/setup-just@v1 |
| 23 | + - name: Cache cargo build |
| 24 | + uses: actions/cache@v1 |
29 | 25 | with: |
30 | | - just-version: "1.39" |
| 26 | + path: target |
| 27 | + key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }} |
31 | 28 |
|
32 | | - - name: Install Rust toolchain |
33 | | - uses: actions-rs/toolchain@v1 |
| 29 | + - uses: actions-rs/toolchain@v1 |
34 | 30 | with: |
35 | | - profile: minimal |
36 | 31 | toolchain: stable |
37 | 32 | override: true |
38 | | - components: rustfmt, clippy |
39 | | - targets: wasm32-unknown-unknown |
40 | 33 |
|
41 | | - - name: Setup rust cache |
42 | | - uses: Swatinem/rust-cache@v2 |
| 34 | + - uses: actions-rs/cargo@v1 |
43 | 35 | with: |
44 | | - shared-key: "benchmark-cache" |
45 | | - cache-directories: | |
46 | | - ~/.cargo/registry |
47 | | - ~/.cargo/git |
48 | | - target |
49 | | -
|
50 | | - - name: Check formatting |
51 | | - run: just fmt |
52 | | - |
53 | | - - name: Run lints |
54 | | - run: just lint |
| 36 | + command: check |
55 | 37 |
|
56 | | - - name: Run tests |
57 | | - run: just test |
| 38 | + - name: test |
| 39 | + run: cargo test |
58 | 40 |
|
59 | | - - name: Run benchmarks |
60 | | - run: just bench |
61 | | - env: |
62 | | - CARGO_TERM_COLOR: always |
| 41 | + - name: bench |
| 42 | + run: cargo bench |
63 | 43 |
|
64 | | - - name: Store benchmark result |
65 | | - uses: benchmark-action/github-action-benchmark@v1 |
| 44 | + - uses: actions/upload-artifact@v4 |
66 | 45 | with: |
67 | | - name: Rust Benchmark |
68 | | - tool: "criterion" |
69 | | - output-file-path: target/criterion/**/new/*.json |
70 | | - alert-threshold: "150%" |
71 | | - github-token: ${{ secrets.GITHUB_TOKEN }} |
72 | | - auto-push: true |
73 | | - # Comment the following lines to use GitHub Pages instead |
74 | | - gh-pages-branch: gh-pages |
75 | | - benchmark-data-dir-path: dev/bench/data |
76 | | - # Uncomment the following lines to publish to GitHub Pages |
77 | | - # publish-to-github-pages: true |
78 | | - # github-pages-branch: gh-pages |
79 | | - # static-site-dir: dev/bench/ |
80 | | - |
81 | | - - name: Check benchmark results |
82 | | - if: github.event_name == 'pull_request' |
83 | | - run: | |
84 | | - if [ -f dev/bench/data/latest.json ]; then |
85 | | - echo "Comparing benchmark results..." |
86 | | - fi |
87 | | -
|
88 | | - - name: Build documentation |
89 | | - run: just docs |
90 | | - |
91 | | -env: |
92 | | - CARGO_TERM_COLOR: always |
93 | | - RUST_BACKTRACE: 1 |
| 46 | + name: rsstable_${{ github.sha }}_bench |
| 47 | + path: ./target/criterion |
0 commit comments