Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(cargo): setup next-binding package #2813

Merged
merged 6 commits into from Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/workflows/test.yml
Expand Up @@ -272,6 +272,8 @@ jobs:

- name: Setup Rust
uses: actions-rs/toolchain@v1
with:
target: wasm32-unknown-unknown

- name: Setup Go
uses: ./.github/actions/setup-go
Expand All @@ -287,6 +289,16 @@ jobs:
command: check
args: --workspace --all-targets

- name: Run cargo feature check for next-binding
run: |
# Known set of feature combinations we need to support
# next-swc/core
cargo check -p next-binding --features __swc_core_next_core,__swc_core_binding_napi_plugin,__swc_core_testing_transform,__swc_testing,__swc_transform_styled_components,__swc_transform_styled_jsx,__swc_transform_emotion,__swc_transform_modularize_imports
# next-swc/napi
cargo check -p next-binding --features __swc_core_binding_napi,__swc_core_binding_napi_plugin,__feature_next_dev_server,__feature_node_file_trace,__feature_mdx_rs
# next-swc/wasm
cargo check -p next-binding --features __swc_core_binding_wasm,__swc_core_binding_wasm_plugin,__feature_mdx_rs --target wasm32-unknown-unknown

Comment on lines +292 to +301
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe move this into the rust_lint step to avoid blocking starting the tests longer than needed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This rust_prepare step is where we ran cargo check already, so I think it's natural fit to chain further --features based check especially this'll allow to reuse rust cache built from previous cargo check. We can measure these times later and trying to optimize further.

rust_lint:
needs: [determine_jobs, rust_prepare]
if: needs.determine_jobs.outputs.rust == 'true'
Expand Down
2 changes: 2 additions & 0 deletions .taplo.toml
Expand Up @@ -5,3 +5,5 @@ keys = ["dependencies", "*-dependencies"]

[rule.formatting]
reorder_keys = true
align_entries = true
indent_tables = true