Update CI PPA scripts for stable branch #719
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: "Dockerized Linux" | |
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/**' | |
jobs: | |
build-docker: | |
timeout-minutes: 55 | |
name: Docker ${{ matrix.image }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
image: | |
- ubuntu-23.04 | |
- fedora-32 | |
- debian-oldstable | |
- debian-stable | |
- debian-sid | |
- debian-sid-i386 | |
- manjaro | |
- fedora-rawhide | |
env: | |
CACHE_NAME: linux | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v3 | |
- name: Prepare | |
id: prep | |
run: | | |
TAG=$(echo $GITHUB_SHA | head -c7) | |
IMAGE="freeorion/freeorion" | |
echo tagged_image=${IMAGE}:${TAG} >> $GITHUB_OUTPUT | |
echo tag=${TAG} >> $GITHUB_OUTPUT | |
- uses: jpribyl/[email protected] | |
# Ignore the failure of a step and avoid terminating the job. | |
continue-on-error: true | |
with: | |
key: docker-layer-cache-${{ matrix.image }}-{hash} | |
restore-keys: | | |
docker-layer-cache-${{ matrix.image }}- | |
layer-docker-layer-cache-${{ matrix.image }} | |
- name: Build production image | |
run: | | |
docker build .github/${{ matrix.image }}/ --file .github/${{ matrix.image }}/Dockerfile --tag ${{ steps.prep.outputs.tagged_image }} | |
- name: Prepare ccache timestamp | |
id: build-docker-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.image }}-docker-ccache-${{ steps.build-docker-ccache-timestamp.outputs.timestamp }} | |
restore-keys: | | |
build-${{ matrix.image }}-docker-ccache- | |
- name: Detect godot | |
id: detect-godot | |
run: | | |
touch ${GITHUB_OUTPUT} | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" --mount type=bind,source=${GITHUB_OUTPUT},target=/github-output.file -e CCACHE_DIR='/ccache_dir' -e GITHUB_OUTPUT=/github-output.file -w /freeorion ${{ steps.prep.outputs.tagged_image }} /usr/bin/cmake -P /freeorion/.github/godot-detect.cmake | |
- name: Copy godot | |
run: | | |
mkdir build | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} cp ${{ steps.detect-godot.outputs.godot }} /freeorion/build/godot | |
- name: Generate godot API file | |
if: ${{ matrix.image != 'manjaro' }} | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /freeorion/build/godot --gdnative-generate-json-api /freeorion/build/godot-api.json | |
- name: Generate godot API file | |
if: ${{ matrix.image == 'manjaro' && false }} # Manjaro stopped to support Godot 3 | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /usr/bin/xvfb-run /freeorion/build/godot --no-window --disable-render-loop --video-driver GLES2 --gdnative-generate-json-api /freeorion/build/godot-api.json | |
- name: Configure freeorion | |
if: ${{ matrix.image == 'ubuntu-23.04' }} | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /usr/bin/cmake -DBUILD_CLIENT_GODOT=ON -DGODOT_CUSTOM_API_FILE=/freeorion/build/godot-api.json -DBUILD_TESTING=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 .. | |
- name: Configure freeorion | |
if: ${{ matrix.image == 'manjaro' }} | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /usr/bin/cmake -DBUILD_CLIENT_GODOT=Off -DBUILD_TESTING=ON .. | |
- name: Configure freeorion | |
if: ${{ matrix.image != 'ubuntu-23.04' && matrix.image != 'manjaro' }} | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /usr/bin/cmake -DBUILD_CLIENT_GODOT=ON -DGODOT_CUSTOM_API_FILE=/freeorion/build/godot-api.json -DBUILD_TESTING=ON .. | |
- name: Build freeorion | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -e GIT_SSL_NO_VERIFY=true -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /usr/bin/cmake --build . -- -j 2 | |
- name: Test freeorion | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -e FO_TEST_HOSTLESS_GAMES=1 -w /freeorion/build ${{ steps.prep.outputs.tagged_image }} /usr/bin/cmake --build . --target unittest | |
- name: Run godot | |
if: ${{ matrix.image != 'fedora-32' && matrix.image != 'manjaro' }} # old Godot 3.1 in Fedora 32 && no headless mode | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/ ${{ steps.prep.outputs.tagged_image }} /freeorion/build/godot --disable-render-loop --verbose -s --path godot addons/gut/gut_cmdln.gd -gdir=res://test/ -ginclude_subdirs -gexit | |
- name: Run godot | |
if: ${{ matrix.image == 'manjaro' && false }} # Manjaro stopped to support Godot 3 | |
run: | | |
docker run -v "$(pwd):/freeorion" -v "${{ runner.temp }}/ccache:/ccache_dir" -e CCACHE_DIR='/ccache_dir' -w /freeorion/ ${{ steps.prep.outputs.tagged_image }} /usr/bin/xvfb-run /freeorion/build/godot --no-window --disable-render-loop --video-driver GLES2 --verbose -s --path godot addons/gut/gut_cmdln.gd -gdir=res://test/ -ginclude_subdirs -gexit |