Skip to content

Commit

Permalink
Deploy 2b252a9 to gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Deploy from CI committed Oct 26, 2023
0 parents commit b6e2e5a
Show file tree
Hide file tree
Showing 116 changed files with 21,687 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[target.'cfg(all())']
rustflags = [
# Global lints/warnings.
# See https://github.com/EmbarkStudios/rust-ecosystem/issues/22 for why they need to be specified here
#
# We don't need a default implementation for every type that implements a new function
"-Aclippy::new_without_default",
# We have a lot of complex types
"-Aclippy::type_complexity",
"-Dclippy::dbg_macro",
"-Dclippy::disallowed_types",
"-Dclippy::disallowed_methods",
]

[target.'cfg(target_os = "unknown")']
# This enables native webgpu bindings
rustflags = ["--cfg=web_sys_unstable_apis"]

[alias]
cf = "run --package campfire --"
campfire = "run --package campfire --"
campfire-slim = "run --package campfire --no-default-features --"
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
target
guest/rust/target
**/tmp/**
.DS_Store
/example_assets
/rust

# WASM
pkg/
node_modules/
bin/
wasm-pack.log
www/.bin/create-wasm-app.js
third_person_camera.cap
35 changes: 35 additions & 0 deletions .github/workflows/book.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy book
on:
push:
branches:
- main
paths:
- 'docs/**'

jobs:
deploy:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install mdbook
run: |
mkdir mdbook
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
echo `pwd`/mdbook >> $GITHUB_PATH
- name: Deploy GitHub Pages
run: |
cd docs
mdbook build
git worktree add gh-pages
git config user.name "Deploy from CI"
git config user.email ""
cd gh-pages
# Delete the ref to avoid keeping history.
git update-ref -d refs/heads/gh-pages
rm -rf *
mv ../book/* .
git add .
git commit -m "Deploy $GITHUB_SHA to gh-pages"
git push --force --set-upstream origin gh-pages
264 changes: 264 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,264 @@
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:
- 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/[email protected]
- 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/[email protected]
- 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:
- 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

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/[email protected]
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/[email protected]
- 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:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Rust cache
uses: Leafwing-Studios/[email protected]
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:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- run: rustup target add --toolchain stable wasm32-wasi
- name: Rust cache
uses: Leafwing-Studios/[email protected]
- 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/[email protected]
- 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
Loading

0 comments on commit b6e2e5a

Please sign in to comment.