-
Notifications
You must be signed in to change notification settings - Fork 1
134 lines (112 loc) · 3.96 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
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 (msvc), Linux (clang), Linux (gcc) ]
include:
- name: Windows (msvc)
runner: windows-2022
cmake_flags: -GNinja -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 libopengl-dev
# SFML assumes the libraries are in "${PROJECT_SOURCE_DIR}/extlibs"
# https://github.com/SFML/SFML/blob/67c9019edad10bc57e2204f75ebf96a1f1ca743a/src/SFML/Audio/CMakeLists.txt#L60-L68
# This doesn’t play well with our build configuration.
- name: Prepare Windows runner
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -Type Directory extlibs
Copy-Item -Recurse "${{ github.workspace }}/external/SFML/extlibs/libs-msvc-universal" "${{ github.workspace }}/extlibs/"
- name: Git Sumbodule Update
run: |
git pull --recurse-submodules
- 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