Skip to content

0.5.0.1 RC 1

0.5.0.1 RC 1 #1141

Workflow file for this run

name: "Ubuntu"
on:
push:
paths-ignore:
- 'msvc*/**'
- 'check/**'
- 'doc/**'
- 'packaging/**'
- 'snap/**'
- '*.md'
- 'check/**'
- 'default/**'
- 'test-scripting/**'
pull_request:
paths-ignore:
- 'msvc*/**'
- 'check/**'
- 'doc/**'
- 'packaging/**'
- 'snap/**'
- '*.md'
- 'check/**'
- 'default/**'
- 'test-scripting/**'
jobs:
build-ubuntu:
name: ${{ matrix.os }} Build FreeOrion GG=${{ matrix.client-gg }} Godot=${{ matrix.client-godot }} compiler ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-20.04]
client-gg: ['ON']
client-godot: ['ON']
compiler: [gcc, clang]
include:
- os: ubuntu-20.04
client-gg: 'ON'
client-godot: 'OFF'
compiler: clang
env:
CACHE_NAME: linux
steps:
- name: Checkout sources
uses: actions/checkout@v3
- uses: actions/cache@v3
id: build-ubuntu-install-cache-id
with:
path: ${{ runner.temp }}/cache-build-linux-install
key: build-${{ matrix.os }}-install-cache-key-v1.0
- uses: airvzxf/[email protected]
with:
script: '${{ matrix.os }}-install-build.sh'
is_cached: ${{ steps.build-ubuntu-install-cache-id.outputs.cache-hit }}
cache: ${{ runner.temp }}/cache-build-linux-install
snapshot: '/'
exclude: '/boot /data /dev /mnt /proc /run /sys'
- name: Prepare ccache timestamp
id: build-ubuntu-ccache-timestamp
shell: cmake -P {0}
run: |
string(TIMESTAMP current_date "%Y-%m-%d-%H;%M;%S" UTC)
file(APPEND "$ENV{GITHUB_OUTPUT}" "timestamp=${current_date}")
- name: Cache files with ccache
uses: actions/cache@v3
with:
path: ${{ runner.temp }}/ccache
key: build-${{ matrix.os }}-${{ matrix.compiler }}-ccache-${{ steps.build-ubuntu-ccache-timestamp.outputs.timestamp }}
restore-keys: |
build-${{ matrix.os }}-${{ matrix.compiler }}-ccache-
- name: Show ccache statistics before build
env:
CCACHE_DIR: ${{ runner.temp }}/ccache
run: |
ccache --show-stats || true
- name: Build directory
run: mkdir build
- name: Configure for gcc
if: ${{ matrix.compiler == 'gcc' }}
env:
CCACHE_DIR: ${{ runner.temp }}/ccache
run: |
cd build
cmake -DBUILD_TESTING=ON -DBUILD_CLIENT_GG=${{ matrix.client-gg }} -DBUILD_CLIENT_GODOT=${{ matrix.client-godot }} ..
- name: Configure for clang
if: ${{ matrix.compiler == 'clang' }}
env:
CCACHE_DIR: ${{ runner.temp }}/ccache
CXXFLAGS: '-I/usr/include/SDL2 -I/usr/include/x86_64-linux-gnu/SDL2/ -I/usr/include/x86_64-linux-gnu/'
CFLAGS: '-I/usr/include/SDL2 -I/usr/include/x86_64-linux-gnu/SDL2/ -I/usr/include/x86_64-linux-gnu/'
CC: clang
CXX: clang++
run: |
cd build
cmake -DBUILD_TESTING=ON -DBUILD_CLIENT_GG=${{ matrix.client-gg }} -DBUILD_CLIENT_GODOT=${{ matrix.client-godot }} ..
- name: Build
env:
CCACHE_DIR: ${{ runner.temp }}/ccache
CMAKE_BUILD_PARALLEL_LEVEL: 2
run: |
cd build
cmake --build .
- name: Show ccache statistics after build
env:
CCACHE_DIR: ${{ runner.temp }}/ccache
run: |
ccache --show-stats || true
- name: Run C++ unit tests
env:
FO_TEST_HOSTLESS_GAMES: 1
run: |
cd build
cmake --build . --config Release --target unittest
- name: Run Godot unit tests
if: matrix.client-godot == 'ON'
run: |
cp `which godot3-server` build/
./build/godot3-server --disable-render-loop --verbose -s --path godot addons/gut/gut_cmdln.gd -gdir=res://test/ -ginclude_subdirs -gexit