Skip to content

Commit

Permalink
Show cargo timings (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel authored Jul 14, 2024
1 parent 3529bf6 commit 3730c16
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUST_BACKTRACE: "full"
- uses: actions/upload-artifact@v4
with:
name: "timings_${{ runner.os }}"
path: |
target/cargo-timings/cargo-timing-*.html
pulumi_wasm_generator_lib/tests/**/target/cargo-timings/cargo-timing-*.html
- name: Ensure no files have changed
run: git diff --exit-code
- uses: benjlevesque/[email protected]
Expand Down
8 changes: 4 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ build-wasm-components:
-p pulumi_wasm_example_simple \
-p pulumi_wasm_example_docker \
-p pulumi_wasm_example_dependencies \
-p pulumi_wasm_example_multiple_providers
-p pulumi_wasm_example_multiple_providers --timings
# DO NOT EDIT - BUILD-WASM-COMPONENTS - START
cargo component build \
-p pulumi_wasm_docker_provider \
-p pulumi_wasm_random_provider \
--timings
# DO NOT EDIT - BUILD-WASM-COMPONENTS - END
cargo build -p pulumi_wasm_runner
cargo test --no-run --all
cargo build -p pulumi_wasm_runner --timings

check:
cargo fmt --all -- --check
Expand All @@ -61,7 +61,7 @@ regenerate-providers:
# DO NOT EDIT - REGENERATE-PROVIDERS - END

test:
cargo nextest run --workspace
cargo nextest run --workspace --timings

docs:
docker run --rm -it -p 8000:8000 -v ${PWD}:/docs squidfunk/mkdocs-material
2 changes: 2 additions & 0 deletions pulumi_wasm_generator_lib/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ fn run_real_provider_test(provider_name: &str) -> Result<()> {
"build",
"-p",
format!("pulumi_wasm_{provider_name}_provider").as_str(),
"--timings",
])
.current_dir(root)
.assert()
Expand All @@ -152,6 +153,7 @@ fn run_real_provider_test(provider_name: &str) -> Result<()> {
"build",
"-p",
format!("pulumi_wasm_{provider_name}").as_str(),
"--timings",
])
.current_dir(root)
.assert()
Expand Down
3 changes: 1 addition & 2 deletions regenerate_providers/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ fn update_cargo_toml(providers: &[Provider]) {
provider.name
));
}

let start_marker = "# DO NOT EDIT - START";
let end_marker = "# DO NOT EDIT - END";
let new_content = replace_between_markers(&content, start_marker, end_marker, &replacement);
Expand Down Expand Up @@ -89,7 +88,7 @@ fn replace_build_wasm_components(providers: &[Provider], content: &str) -> Strin
provider.name
));
}

replacement.push_str(" --timings\n");
let start_marker =
" # DO NOT EDIT - BUILD-WASM-COMPONENTS - START\n cargo component build \\";
let end_marker = " # DO NOT EDIT - BUILD-WASM-COMPONENTS - END";
Expand Down

0 comments on commit 3730c16

Please sign in to comment.