Moved getTileDescByGrid to OutdoorLocation #3320
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: Linux | |
on: | |
pull_request: null | |
workflow_dispatch: | |
inputs: | |
myCommit: | |
description: Commit SHA1 | |
required: false | |
default: '' | |
type: string | |
releaseTag: | |
description: Release tag | |
required: false | |
default: '' | |
type: string | |
workflow_call: | |
inputs: | |
myCommit: | |
description: Commit SHA1 | |
required: false | |
default: '' | |
type: string | |
releaseTag: | |
description: Release tag | |
required: false | |
default: '' | |
type: string | |
push: null | |
release: | |
types: | |
- published | |
# cancels currently running workflow from the same PR, branch or tag | |
#concurrency: | |
# group: ${{github.workflow}}-${{github.ref}} | |
# cancel-in-progress: true | |
jobs: | |
build_linux: | |
timeout-minutes: 60 | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
configuration: | |
- Debug | |
- RelWithDebInfo | |
architecture: | |
- x86 | |
- x86_64 | |
steps: | |
- name: Configure fast APT mirror | |
uses: vegardit/fast-apt-mirror.sh@v1 | |
with: # the following parameters are listed with their action default values and are optional | |
healthchecks: 10 # Number of mirrors from the mirrors list to check for availability and up-to-dateness | |
speedtests: 6 # Maximum number of healthy mirrors to test for speed | |
parallel: 2 # Number of parallel speed tests | |
sample-size: 1024 # Number of kilobytes to download during the speed from each mirror | |
sample-time: 3 # Maximum number of seconds within the sample download from a mirror must finish | |
- name: Checkout | |
uses: actions/checkout@v4.2.2 | |
with: | |
submodules: recursive | |
ref: '${{inputs.myCommit}}' | |
- name: Restore data cache | |
id: restore-data-cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: | | |
OpenEnroth_GameData | |
key: data-cache | |
- name: Install dependencies | |
run: | | |
if [ "${{matrix.architecture}}" = "x86" ]; then | |
sudo dpkg --add-architecture i386 | |
fi | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y | |
sudo apt-get update | |
if [ "${{matrix.architecture}}" = "x86" ]; then | |
sudo apt-get install -y gcc-13-multilib g++-13-multilib lld | |
sudo apt-get install -y libglu1-mesa-dev:i386 | |
sudo apt-get install -y libsdl2-dev:i386 | |
sudo apt-get install -y libdwarf-dev:i386 libelf-dev:i386 | |
fi | |
if [ "${{matrix.architecture}}" = "x86_64" ]; then | |
sudo apt-get install -y gcc-13 g++-13 lld | |
sudo apt-get install -y libglu1-mesa-dev | |
sudo apt-get install -y libsdl2-dev | |
sudo apt-get install -y libdwarf-dev libelf-dev | |
fi | |
- name: Run ccache | |
uses: hendrikmuhs/ccache-action@v1.2.14 | |
with: | |
key: 'linux-${{matrix.configuration}}-${{matrix.architecture}}' | |
save: ${{ github.ref == 'refs/heads/master' || inputs.releaseTag != '' }} | |
verbose: 2 | |
max-size: 200M | |
- name: Configure | |
run: | | |
if [ "${{matrix.architecture}}" = "x86" ]; then | |
export CFLAGS="-m32" CXXFLAGS="-m32" | |
fi | |
export CC=gcc-13 && export CXX=g++-13 | |
cmake -B build -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=${{matrix.configuration}} | |
- name: Build | |
working-directory: build | |
run: | | |
make -j3 | |
- name: Run unit tests | |
working-directory: build | |
run: | | |
make Run_UnitTest | |
- name: Run game tests | |
if: steps.restore-data-cache.outputs.cache-hit == 'true' | |
working-directory: build | |
run: | | |
make Run_GameTest_Headless_Parallel | |
env: | |
OPENENROTH_MM7_PATH: /home/runner/work/OpenEnroth/OpenEnroth/OpenEnroth_GameData/mm7 | |
- name: Run retrace tests | |
if: steps.restore-data-cache.outputs.cache-hit == 'true' && matrix.configuration != 'Debug' | |
working-directory: build | |
run: | | |
make Run_RetraceTest_Headless_Parallel | |
env: | |
OPENENROTH_MM7_PATH: /home/runner/work/OpenEnroth/OpenEnroth/OpenEnroth_GameData/mm7 | |
- name: Prepare artifact | |
run: | | |
mkdir dist | |
cp build/src/Bin/OpenEnroth/OpenEnroth dist/ | |
- name: Zip folder for release | |
if: inputs.releaseTag != '' | |
uses: thedoctor0/zip-release@0.7.1 | |
with: | |
type: zip | |
filename: ${{runner.os}}_${{inputs.releaseTag}}_${{matrix.configuration}}_${{matrix.architecture}}.zip | |
path: dist | |
- name: Publish release | |
if: inputs.releaseTag != '' | |
uses: softprops/action-gh-release@v1 | |
with: | |
prerelease: true | |
tag_name: '${{inputs.releaseTag}}' | |
files: | | |
${{runner.os}}_${{inputs.releaseTag}}_${{matrix.configuration}}_${{matrix.architecture}}.zip | |
- name: Check dependencies | |
run: | | |
objdump -p build/src/Bin/OpenEnroth/OpenEnroth | grep 'NEEDED' | |
- name: Cleanup ccache | |
run: | | |
ccache -c |