CI #10
Workflow file for this run
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: | |
- master | |
pull_request: | |
types: [ opened, synchronize, reopened ] | |
workflow_dispatch: | |
defaults: | |
run: | |
shell: bash | |
env: | |
DISPLAY: ":99" # Display number to use for the X server | |
GALLIUM_DRIVER: llvmpipe # Use Mesa 3D software OpenGL renderer | |
jobs: | |
# TODO: check formatting | |
#format: | |
# name: Formatting | |
# runs-on: ubuntu-22.04 | |
build: | |
name: Build ${{ matrix.name }} | |
runs-on: ${{ matrix.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
name: [ Windows (clang), Linux (clang), Linux (gcc) ] | |
include: | |
- name: Windows (clang) | |
runner: windows-2022 | |
cmake_flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DSFML_USE_MESA3D=TRUE | |
- name: Linux (clang) | |
runner: ubuntu-22.04 | |
cmake_flags: -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug | |
- name: Linux (gcc) | |
runner: ubuntu-22.04 | |
cmake_flags: -GNinja -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: 'true' | |
- name: Get CMake and Ninja | |
uses: lukka/get-cmake@latest | |
with: | |
cmakeVersion: '3.22' | |
ninjaVersion: latest | |
# From https://github.com/SFML/SFML/blob/67c9019edad10bc57e2204f75ebf96a1f1ca743a/.github/workflows/ci.yml#L93 | |
- name: Install Linux Dependencies | |
if: runner.os == 'Linux' | |
run: | | |
sudo apt-get update | |
sudo apt-get install xorg-dev libxrandr-dev libxcursor-dev libudev-dev libopenal-dev libflac-dev libvorbis-dev libgl1-mesa-dev libegl1-mesa-dev libdrm-dev libgbm-dev xvfb fluxbox | |
- name: Configure CMake | |
run: | | |
mkdir build | |
cd build | |
cmake .. -DCMAKE_VERBOSE_MAKEFILE=ON ${{matrix.cmake_flags}} | |
- name: Build | |
run: cmake --build ./build --target ninja-clown | |
- name: Build tests | |
if: runner.os == 'Linux' | |
run: cmake --build ./build --target ninja-clown-tests | |
- name: Prepare tests | |
if: runner.os == 'Linux' | |
run: | | |
set -e | |
# Start up Xvfb and fluxbox to host display tests | |
Xvfb $DISPLAY -screen 0 1920x1080x24 & | |
sleep 5 | |
fluxbox > /dev/null 2>&1 & | |
sleep 5 | |
- name: Run tests | |
if: runner.os == 'Linux' | |
run: | | |
cd ./build | |
./ninja-clown-tests | |
# TODO: | |
#tidy: | |
# name: Tidy | |
# runs-on: ubuntu-22.04 | |
check-rust: | |
name: Rust example bot | |
runs-on: ubuntu-22.04 | |
env: | |
# Disable incremental compilation. CI builds are often closer to from-scratch builds, as changes | |
# are typically bigger than from a local edit-compile cycle. | |
# Incremental compilation also significantly increases the amount of IO and the size of ./target | |
# folder. | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUSTUP_MAX_RETRIES: 10 | |
RUST_BACKTRACE: short | |
CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse | |
# Disabling debug info so compilation is faster and ./target folder is smaller. | |
CARGO_PROFILE_DEV_DEBUG: 0 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build example | |
env: | |
RUSTFLAGS: -D warnings | |
run: cargo build --manifest-path=examples/rust-bot/Cargo.toml |