Update version for 7853610b41f8482b3c3393aacd05c0c34e6d4739 #3073
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
name: CI | |
on: | |
push: | |
branches: ["main"] | |
paths-ignore: | |
- "docs/**" | |
- "README.md" | |
pull_request: | |
branches: ["main"] | |
paths-ignore: | |
- "docs/**" | |
- "README.md" | |
env: | |
CARGO_TERM_COLOR: always | |
CARGO_INCREMENTAL: 0 | |
jobs: | |
clippy: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y tree libasound2-dev libglib2.0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ | |
libcairo-dev libgtk2.0-dev libsoup2.4-dev libgtk-3-dev libwebkit2gtk-4.0-dev xorg-dev ninja-build libxcb-render0-dev | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
- name: Run clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --workspace --examples --tests | |
clippy-web: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y tree libasound2-dev libglib2.0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ | |
libcairo-dev libgtk2.0-dev libsoup2.4-dev libgtk-3-dev libwebkit2gtk-4.0-dev xorg-dev ninja-build libxcb-render0-dev | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
target: wasm32-unknown-unknown | |
- name: Run clippy | |
working-directory: web | |
run: cargo clippy --workspace | |
test-linux: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y tree libasound2-dev libglib2.0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ | |
libcairo-dev libgtk2.0-dev libsoup2.4-dev libgtk-3-dev libwebkit2gtk-4.0-dev xorg-dev ninja-build libxcb-render0-dev | |
- name: Install run (headless) dependencies | |
run: | | |
sudo apt-get update | |
sudo apt install -y libxcb-xfixes0-dev vulkan-validationlayers-dev mesa-vulkan-drivers libasound2-dev | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
- uses: taiki-e/install-action@cargo-nextest | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
env: | |
RUSTFLAGS: "-C debuginfo=0" | |
with: | |
command: nextest | |
args: run --workspace | |
# Provides a history of the cache content builds over build to make troubleshooting easier | |
- name: Display target directory content | |
run: tree --du -h target | |
build-api-and-doc: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Check that guest/rust's documentation is well-formed | |
run: cd guest/rust && RUSTDOCFLAGS="-Dwarnings" cargo doc --workspace --all-features --no-deps | |
- name: Check that guest/rust builds under all configurations | |
run: cargo campfire-slim package check-all --delete-target | |
build-web: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Install build dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y tree libasound2-dev libglib2.0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ | |
libcairo-dev libgtk2.0-dev libsoup2.4-dev libgtk-3-dev libwebkit2gtk-4.0-dev xorg-dev ninja-build libxcb-render0-dev | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
toolchain: stable | |
target: wasm32-unknown-unknown | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
with: | |
cargo-target-dir: "web/target" | |
- name: "Build campfire" | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --package campfire --no-default-features | |
- name: "Build web client" | |
uses: actions-rs/cargo@v1 | |
with: | |
command: run | |
args: --package campfire --no-default-features -- web build --profile release --target standalone | |
- name: Upload package | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ambient-web-standalone | |
path: ./web/pkg | |
build: | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
- os: windows-latest | |
- os: ubuntu-22.04 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Free up disk space | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- name: Install build dependencies | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
sudo apt-get update | |
sudo apt-get install --no-install-recommends -y tree libasound2-dev libglib2.0-dev libxcb-shape0-dev libxcb-xfixes0-dev \ | |
libcairo-dev libgtk2.0-dev libsoup2.4-dev libgtk-3-dev libwebkit2gtk-4.0-dev xorg-dev ninja-build libxcb-render0-dev clang nodejs | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
- name: Build | |
run: cargo build --workspace --release | |
- name: Upload ambient executable artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: ambient-${{ matrix.os }} | |
path: | | |
target/release/ambient | |
target/release/ambient.exe | |
build-guest-rust: | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
- os: windows-latest | |
- os: ubuntu-22.04 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Free up disk space | |
if: ${{ matrix.os == 'ubuntu-22.04' }} | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
with: | |
cargo-target-dir: "guest/rust/target" | |
- name: Build guest/rust | |
run: cd guest/rust && cargo build --workspace | |
golden-image-tests: | |
needs: build | |
runs-on: ubuntu-22.04 | |
env: | |
RUST_LOG: ambient_gpu=info | |
EXAMPLES_ASSETS_HOST: ${{ secrets.EXAMPLES_ASSETS_HOST }} | |
steps: | |
- name: Free up disk space | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf /opt/ghc | |
sudo rm -rf "/usr/local/share/boost" | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: rustup target add --toolchain stable wasm32-wasi | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
- name: Download ambient executable | |
uses: actions/download-artifact@v3 | |
with: | |
name: ambient-ubuntu-22.04 | |
- run: chmod a+x ambient | |
- name: Install run (headless) dependencies | |
run: | | |
sudo apt-get update | |
sudo apt install -y libxcb-xfixes0-dev vulkan-validationlayers-dev mesa-vulkan-drivers libasound2-dev | |
- name: Run golden image tests | |
run: cargo campfire-slim golden-images --ambient-path=./ambient check | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: screenshots | |
path: | | |
guest/rust/examples/*/*/screenshot.png | |
guest/rust/examples/*/*/fail_screenshot.png | |
test-new-package-works: | |
needs: build | |
strategy: | |
matrix: | |
include: | |
- os: macos-latest | |
# We run out of storage space when trying to build and run the package on Windows. | |
# It would be nice to fix this at some point. | |
# - os: windows-latest | |
- os: ubuntu-22.04 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: dtolnay/rust-toolchain@stable | |
- run: rustup target add --toolchain stable wasm32-wasi | |
- uses: actions/checkout@v3 | |
- name: Rust cache | |
uses: Leafwing-Studios/cargo-cache@v1.1.0 | |
- name: Download ambient executable | |
uses: actions/download-artifact@v3 | |
with: | |
name: ambient-${{ matrix.os }} | |
- run: chmod a+x ambient | |
- name: Check that new-package works | |
run: | | |
mkdir tmp | |
./ambient new --api-path $(pwd)/guest/rust/api /tmp/ci_test_package | |
cd /tmp/ci_test_package | |
cargo check -F client,server |