Skip to content

Commit

Permalink
wip: benchmarks github action
Browse files Browse the repository at this point in the history
  • Loading branch information
lann committed Mar 18, 2022
1 parent 5e8098b commit 9757a26
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
36 changes: 29 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,41 @@ jobs:
url: "https://github.com/deislabs/bindle/releases/download/v0.8.0/bindle-v0.8.0-linux-amd64.tar.gz"
pathInArchive: "bindle-server"

- name: Cargo Format
run:
cargo fmt --all -- --check

- uses: Swatinem/rust-cache@v1

- name: Cargo Build
run: cargo build
- name: Cargo Test
run:
RUST_LOG=spin=trace cargo test --all --all-features -- --nocapture
- name: Cargo Clippy
run:
cargo clippy --all-targets --all-features -- -D warnings
- name: Cargo Format

- name: Cargo Test
run:
cargo fmt --all -- --check
RUST_LOG=spin=trace cargo test --all --all-features -- --nocapture

- name: Cargo Build
run: cargo build --release

- name: Download previous benchmark results
# if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/download-artifact@v3
continue-on-error: true
with:
name: benchmark-data
path: target/criterion
- name: Benchmarks
# if: ${{ github.ref == 'refs/heads/main' }}
run: |
cargo install cargo-criterion
cargo criterion --workspace
- name: Upload benchmark results
# if: ${{ github.ref == 'refs/heads/main' }}
uses: actions/upload-artifact@v3
with:
name: benchmark-data
path: target/criterion

# Cancel in-progress runs for PRs
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value
Expand Down
2 changes: 1 addition & 1 deletion tests/http/simple-spin-rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ wit_bindgen_rust::export!("spin-http.wit");
struct SpinHttp {}
impl spin_http::SpinHttp for SpinHttp {
// Implement the `handler` entrypoint for Spin HTTP components.
fn handler(req: Request) -> Response {
fn handler(_req: Request) -> Response {
Response {
status: 200,
headers: None,
Expand Down

0 comments on commit 9757a26

Please sign in to comment.