mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-10 02:07:55 -06:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 57c7afcdb4 | |||
| 2e16c2d170 | |||
| f86c106593 |
36
.github/workflows/build.yaml
vendored
36
.github/workflows/build.yaml
vendored
@@ -111,8 +111,42 @@ jobs:
|
|||||||
run_install: true
|
run_install: true
|
||||||
|
|
||||||
- name: Build with Emscripten
|
- name: Build with Emscripten
|
||||||
|
shell: bash
|
||||||
run: |
|
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 "::warning::Detected 'emcc: error: Unexpected hash:' error - will retry (attempt $attempt of $MAX_RETRIES)"
|
||||||
|
|
||||||
|
if [ $attempt -eq $MAX_RETRIES ]; then
|
||||||
|
echo "::error::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
|
- name: Assemble
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
12
.github/workflows/coverage.yaml
vendored
12
.github/workflows/coverage.yaml
vendored
@@ -18,6 +18,7 @@ jobs:
|
|||||||
uses: dtolnay/rust-toolchain@master
|
uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
toolchain: ${{ env.RUST_TOOLCHAIN }}
|
||||||
|
components: llvm-tools-preview
|
||||||
|
|
||||||
- name: Rust Cache
|
- name: Rust Cache
|
||||||
uses: Swatinem/rust-cache@v2
|
uses: Swatinem/rust-cache@v2
|
||||||
@@ -40,20 +41,17 @@ jobs:
|
|||||||
cargo install cargo-vcpkg
|
cargo install cargo-vcpkg
|
||||||
cargo vcpkg -v build
|
cargo vcpkg -v build
|
||||||
|
|
||||||
- name: Install cargo-tarpaulin
|
- uses: taiki-e/install-action@cargo-llvm-cov
|
||||||
run: cargo install cargo-tarpaulin
|
- 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.
|
# Note: We manually link zlib. This should be synchronized with the flags set for Linux in .cargo/config.toml.
|
||||||
- name: Generate coverage report
|
- name: Generate coverage report
|
||||||
run: |
|
run: |
|
||||||
cargo tarpaulin \
|
cargo llvm-cov --no-fail-fast --lcov --output-path lcov.info nextest
|
||||||
--out Lcov \
|
|
||||||
--output-dir coverage \
|
|
||||||
--rustflags="-C link-arg=-lz"
|
|
||||||
|
|
||||||
- name: Upload coverage to Coveralls
|
- name: Upload coverage to Coveralls
|
||||||
uses: coverallsapp/github-action@v2
|
uses: coverallsapp/github-action@v2
|
||||||
with:
|
with:
|
||||||
files: ./coverage/lcov.info
|
files: ./lcov.info
|
||||||
format: lcov
|
format: lcov
|
||||||
allow-empty: false
|
allow-empty: false
|
||||||
|
|||||||
6
.github/workflows/test.yaml
vendored
6
.github/workflows/test.yaml
vendored
@@ -42,8 +42,10 @@ jobs:
|
|||||||
cargo install cargo-vcpkg
|
cargo install cargo-vcpkg
|
||||||
cargo vcpkg -v build
|
cargo vcpkg -v build
|
||||||
|
|
||||||
- name: Run tests
|
- uses: taiki-e/install-action@nextest
|
||||||
run: cargo test --workspace --verbose
|
|
||||||
|
- name: Run nextest
|
||||||
|
run: cargo nextest run --workspace
|
||||||
|
|
||||||
- name: Run clippy
|
- name: Run clippy
|
||||||
run: cargo clippy -- -D warnings
|
run: cargo clippy -- -D warnings
|
||||||
|
|||||||
Reference in New Issue
Block a user