Skip to content

CI

CI #3

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
types: [ opened, synchronize, reopened ]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
# TODO: check formatting
#format:
# name: Formatting
# runs-on: ubuntu-22.04
build:
name: Build [${{ matrix.os }}]
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: true
matrix:
os: [ win, linux ]
include:
- os: win
runner: windows-2022
- os: linux
runner: ubuntu-22.04
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_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -GNinja ..
- name: Build
run: cmake --build ./build --target ninja-clown
- name: Build tests
if: matrix.os == 'linux'
run: cmake --build ./build --target ninja-clown-tests
- name: Run tests
if: matrix.os == 'linux'
run: ./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