Skip to content

Commit 78c9827

Browse files
committed
fix: split test jobs to resolve Docker service incompatibility on macOS
- Split test job into test-linux and test-macos to handle platform differences - Docker registry service only available on Linux runners, not macOS - test-linux: includes Docker registry service for OCI tests - test-macos: excludes simple_oci_test targets since Docker unavailable - Update job dependencies for integration and release jobs
1 parent 11479d5 commit 78c9827

File tree

1 file changed

+98
-17
lines changed

1 file changed

+98
-17
lines changed

.github/workflows/ci.yml

Lines changed: 98 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,10 @@ jobs:
3636
# Show warnings but don't fail the CI
3737
bazel run //:buildifier -- --lint=warn --mode=check -r . || true
3838
39-
test:
40-
name: Test on ${{ matrix.os }}
41-
runs-on: ${{ matrix.os }}
39+
test-linux:
40+
name: Test on ubuntu-latest
41+
runs-on: ubuntu-latest
4242
needs: lint # Run tests only after lint passes
43-
strategy:
44-
matrix:
45-
os: [ubuntu-latest, macos-latest]
4643

4744
services:
4845
registry:
@@ -72,15 +69,99 @@ jobs:
7269
7370
- name: Install Bazelisk
7471
run: |
75-
if [[ "$RUNNER_OS" == "Linux" ]]; then
76-
curl -LO https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64
77-
chmod +x bazelisk-linux-amd64
78-
sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel
79-
elif [[ "$RUNNER_OS" == "macOS" ]]; then
80-
curl -LO https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-darwin-amd64
81-
chmod +x bazelisk-darwin-amd64
82-
sudo mv bazelisk-darwin-amd64 /usr/local/bin/bazel
83-
fi
72+
curl -LO https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-linux-amd64
73+
chmod +x bazelisk-linux-amd64
74+
sudo mv bazelisk-linux-amd64 /usr/local/bin/bazel
75+
76+
- name: Install Rust
77+
uses: dtolnay/rust-toolchain@stable
78+
with:
79+
targets: wasm32-wasip1,wasm32-wasip2,wasm32-unknown-unknown
80+
components: clippy
81+
82+
- name: Verify Bazel Installation
83+
run: bazel version
84+
85+
- name: Build All Targets
86+
run: |
87+
# Build core working targets, exclude incomplete/problematic examples
88+
bazel build -- //... \
89+
-//examples/world_export/... \
90+
-//examples/multi_profile/... \
91+
-//examples/cpp_component/... \
92+
-//examples/js_component/... \
93+
-//examples/go_component/... \
94+
-//examples/wac_remote_compose/... \
95+
-//examples/wac_oci_composition/... \
96+
-//examples/wkg_integration/... \
97+
-//examples/wizer_example/... \
98+
-//test_wac/... \
99+
-//test/wkg/... \
100+
-//test/production/... \
101+
-//tools-builder/... \
102+
-//examples/basic:hello_component_wasm_lib_release \
103+
-//test/export_macro:test_component_wasm_lib_release \
104+
-//test/integration:basic_component_wasm_lib_debug \
105+
-//test/integration:basic_component_wasm_lib_release \
106+
-//test/integration:consumer_component_wasm_lib_release \
107+
-//test/integration:service_a_component_wasm_lib_release \
108+
-//test/integration:service_b_component_wasm_lib_release \
109+
-//test/integration:wasi_component_wasm_lib_release \
110+
-//test/integration:multi_service_system \
111+
-//test/integration:wasi_system \
112+
-//test/integration:composition_build_test \
113+
-//test/integration:integration_tests \
114+
-//test/unit:test_component_simple_wasm_lib_release \
115+
-//test/unit:test_component_with_deps_wasm_lib_release \
116+
-//test/unit:test_composition \
117+
-//test_examples/basic:hello_component_wasm_lib_release \
118+
-//test_examples/dependencies/consumer:consumer_component_wasm_lib_release \
119+
-//test_wit_deps/consumer:consumer_component_wasm_lib_release
120+
121+
- name: Run Tests
122+
run: bazel test --test_output=errors -- //test/integration:basic_component_build_test //test/integration:basic_component_validation //test/unit:unit_tests
123+
124+
- name: Run Clippy
125+
run: echo "Skipping clippy for now due to target triple issues"
126+
127+
- name: Validate Toolchain Download Fix
128+
run: echo "Skipping toolchain download validation test due to network dependency"
129+
130+
- name: Build Examples
131+
run: |
132+
bazel build //examples/basic:hello_component
133+
134+
- name: Validate Generated Files
135+
run: |
136+
# Check that WASM files are valid
137+
bazel build //examples/basic:hello_component
138+
wasm-tools validate bazel-bin/examples/basic/hello_component.wasm || true
139+
140+
test-macos:
141+
name: Test on macos-latest
142+
runs-on: macos-latest
143+
needs: lint # Run tests only after lint passes
144+
145+
steps:
146+
- uses: actions/checkout@v4
147+
with:
148+
submodules: false
149+
150+
- name: Cache Bazel
151+
uses: actions/cache@v4
152+
with:
153+
path: |
154+
~/.cache/bazel
155+
~/.cache/bazelisk
156+
key: ${{ runner.os }}-bazel-${{ hashFiles('MODULE.bazel', 'WORKSPACE.bazel', '**/*.bzl') }}
157+
restore-keys: |
158+
${{ runner.os }}-bazel-
159+
160+
- name: Install Bazelisk
161+
run: |
162+
curl -LO https://github.com/bazelbuild/bazelisk/releases/latest/download/bazelisk-darwin-amd64
163+
chmod +x bazelisk-darwin-amd64
164+
sudo mv bazelisk-darwin-amd64 /usr/local/bin/bazel
84165
85166
- name: Install Rust
86167
uses: dtolnay/rust-toolchain@stable
@@ -237,7 +318,7 @@ jobs:
237318
integration:
238319
name: Integration Tests
239320
runs-on: ubuntu-latest
240-
needs: test
321+
needs: [test-linux, test-macos]
241322

242323
steps:
243324
- uses: actions/checkout@v4
@@ -329,7 +410,7 @@ jobs:
329410
release:
330411
name: Release
331412
runs-on: ubuntu-latest
332-
needs: [test, integration, bcr-docker-test]
413+
needs: [test-linux, test-macos, integration, bcr-docker-test]
333414
if: github.ref == 'refs/heads/main'
334415

335416
steps:

0 commit comments

Comments
 (0)