Compare commits

...

2 Commits

3 changed files with 44 additions and 10 deletions

View File

@@ -111,8 +111,42 @@ jobs:
run_install: true
- name: Build with Emscripten
shell: bash
run: |
cargo build --target=wasm32-unknown-emscripten --release
# Retry mechanism for Emscripten build - only retry on specific hash errors
MAX_RETRIES=3
RETRY_DELAY=30
for attempt in $(seq 1 $MAX_RETRIES); do
echo "Build attempt $attempt of $MAX_RETRIES"
# Capture output and check for specific error while preserving real-time output
if cargo build --target=wasm32-unknown-emscripten --release 2>&1 | tee /tmp/build_output.log; then
echo "Build successful on attempt $attempt"
break
else
echo "Build failed on attempt $attempt"
# Check if the failure was due to the specific hash error
if grep -q "emcc: error: Unexpected hash:" /tmp/build_output.log; then
echo "Detected 'emcc: error: Unexpected hash:' error - will retry"
if [ $attempt -eq $MAX_RETRIES ]; then
echo "All retry attempts failed. Exiting with error."
exit 1
fi
echo "Waiting $RETRY_DELAY seconds before retry..."
sleep $RETRY_DELAY
# Exponential backoff: double the delay for next attempt
RETRY_DELAY=$((RETRY_DELAY * 2))
else
echo "Build failed but not due to hash error - not retrying"
exit 1
fi
fi
done
- name: Assemble
run: |

View File

@@ -18,6 +18,7 @@ jobs:
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_TOOLCHAIN }}
components: llvm-tools-preview
- name: Rust Cache
uses: Swatinem/rust-cache@v2
@@ -40,20 +41,17 @@ jobs:
cargo install cargo-vcpkg
cargo vcpkg -v build
- name: Install cargo-tarpaulin
run: cargo install cargo-tarpaulin
- uses: taiki-e/install-action@cargo-llvm-cov
- uses: taiki-e/install-action@nextest
# Note: We manually link zlib. This should be synchronized with the flags set for Linux in .cargo/config.toml.
- name: Generate coverage report
run: |
cargo tarpaulin \
--out Lcov \
--output-dir coverage \
--rustflags="-C link-arg=-lz"
cargo llvm-cov --no-fail-fast --lcov --output-path lcov.info nextest
- name: Upload coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
files: ./coverage/lcov.info
files: ./lcov.info
format: lcov
allow-empty: false

View File

@@ -42,8 +42,10 @@ jobs:
cargo install cargo-vcpkg
cargo vcpkg -v build
- name: Run tests
run: cargo test --workspace --verbose
- uses: taiki-e/install-action@nextest
- name: Run nextest
run: cargo nextest run --workspace
- name: Run clippy
run: cargo clippy -- -D warnings