-
Notifications
You must be signed in to change notification settings - Fork 5
70 lines (60 loc) · 2.65 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Continuous Integration only tests on linux desktop
name: Continuous Integration
on:
push:
branches: "master"
pull_request:
branches: "master"
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/[email protected]
- 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 grep -i -q "error" app.log; 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