Skip to content

Commit

Permalink
chore(ci): fix rust publish workflow
Browse files Browse the repository at this point in the history
Rust publish workflow has failed because it couldn’t build
fastly-edge-assignments.

Split fastly-edge-assignments off workspace, so it’s not build on
release.
  • Loading branch information
rasendubi committed Dec 5, 2024
1 parent 5039907 commit 29dab98
Show file tree
Hide file tree
Showing 5 changed files with 2,301 additions and 12 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:

env:
CARGO_TERM_COLOR: always
SDK_BRANCH: ${{ inputs.sdk_branch || github.ref || 'main' }}
SDK_BRANCH: ${{ inputs.sdk_branch || github.ref || 'main' }}
TEST_DATA_BRANCH: ${{ inputs.test_data_branch || 'main' }}

jobs:
Expand All @@ -45,12 +45,13 @@ jobs:

- run: npm ci
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo build --verbose --all-targets --workspace

- run: cargo test --verbose --workspace
- run: cargo doc --verbose

# Add WASM target
- run: rustup target add wasm32-wasi
# Build non-WASM targets
- run: cargo build --verbose --all-targets --workspace --exclude fastly-edge-assignments
# Build WASM target separately
- run: cargo build --verbose -p fastly-edge-assignments --target wasm32-wasi
# Run tests (excluding WASM package)
- run: cargo test --verbose --workspace --exclude fastly-edge-assignments
- run: cargo doc --verbose
- run: cargo build --verbose --target wasm32-wasi
working-directory: fastly-edge-assignments
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ members = [
"rust-sdk",
"python-sdk",
"ruby-sdk/ext/eppo_client",
"fastly-edge-assignments",
]

exclude = [
"fastly-edge-assignments",
]

[patch.crates-io]
Expand Down
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,22 @@ test: ${testDataDir}
# Build the entire workspace excluding the `fastly-edge-assignments` package
.PHONY: workspace-build
workspace-build:
cargo build --workspace --exclude $(FASTLY_PACKAGE)
cargo build

# Run tests for the entire workspace excluding the `fastly-edge-assignments` package
.PHONY: workspace-test
workspace-test:
cargo test --workspace --exclude $(FASTLY_PACKAGE)
cargo test

# Build only the `fastly-edge-assignments` package for WASM
.PHONY: fastly-edge-assignments-build
fastly-edge-assignments-build:
rustup target add $(WASM_TARGET)
cargo build --release --target $(WASM_TARGET) --package $(FASTLY_PACKAGE)
cd fastly-edge-assignments
cargo build --release --target $(WASM_TARGET)

# Test only the `fastly-edge-assignments` package
.PHONY: fastly-edge-assignments-test
fastly-edge-assignments-test:
cargo test --target $(WASM_TARGET) --package $(FASTLY_PACKAGE)
cd fastly-edge-assignments
cargo test --target $(WASM_TARGET)
4 changes: 4 additions & 0 deletions fastly-edge-assignments/.cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
[build]
target = "wasm32-wasi"

[patch.crates-io]
# Local override for development.
eppo_core = { path = '../eppo_core' }
Loading

0 comments on commit 29dab98

Please sign in to comment.