Lock file maintenance #1024
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Continuous Integration only tests on linux desktop | |
name: Continuous Integration | |
on: | |
push: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
permissions: # codeql | |
contents: read | |
security-events: write | |
jobs: | |
ci: | |
name: Continuous Integration | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download repository | |
uses: actions/checkout@v4 | |
- name: Update cargo | |
run: | | |
rustup update | |
- uses: Swatinem/rust-cache@v2.7.5 | |
- name: Install dependencies for three-d on Ubuntu | |
run: sudo apt update && sudo apt upgrade -y && sudo apt install -y pkg-config libx11-dev libxi-dev libgl1-mesa-dev libasound2-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libspeechd-dev libxkbcommon-x11-dev libxkbcommon-dev libssl-dev libatk1.0-dev libgtk-3-dev | |
- name: Test | |
run: | | |
cargo test --features "app server sdfdemo meshers" --lib # Test different feature combinations? | |
- name: Integration test with sdf-viewer-go | |
run: | | |
# Start the app for the latest wasm generated | |
# If the app did not log any errors and is running after N seconds, then the test is successful | |
cargo build --features "app server sdfdemo meshers" # Ensure app is built before running to avoid hitting the time limit | |
xvfb-run cargo run --features "app server sdfdemo meshers" -- app url https://yeicor.github.io/sdf-viewer-go/sdf-viewer-go-sdfx.wasm >app.log & | |
# Print the app log while the app is running | |
timeout 30s tail -f app.log || echo "Stopping and checking app.log for errors..." | |
# Kill the app that was running in the background | |
kill %1 | |
# Check for errors | |
if cat app.log | grep -v "MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)" | grep -i -q "error"; then | |
echo "> Error found in app.log" | |
exit 1 | |
fi | |
# Check that the app finished loading... (2 times as it loads the demo first) | |
if [ $(grep -i "Loaded last" app.log | wc -l) -lt 2 ]; then | |
echo "> App did not finish loading" | |
exit 1 | |
fi | |
- run: rustup component add clippy # rustfmt | |
- name: Install clippy extras | |
run: cargo install clippy-sarif sarif-fmt | |
- name: Run rust-clippy | |
run: | |
cargo clippy --features "app server sdfdemo meshers" --message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt | |
continue-on-error: true | |
- name: Upload analysis results to GitHub | |
uses: github/codeql-action/upload-sarif@v3 | |
with: | |
sarif_file: rust-clippy-results.sarif | |
wait-for-processing: true |