Skip to content

Store gameplay affecting settings in a game_state struct #2260

Store gameplay affecting settings in a game_state struct

Store gameplay affecting settings in a game_state struct #2260

Workflow file for this run

name: CI
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
repository_dispatch:
types: [run_build]
jobs:
# Run unittests on a recent version of clang
# -----------------------------------------------------------------------------------------------
unittest:
name: Formatting Check, Unittest
runs-on: ubuntu-24.04
env:
clang-version: '18'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Install dependencies
uses: Eeems-Org/[email protected]
with:
packages: cmake cmake-data ninja-build libargtable2-dev libcunit1-dev
libsdl2-mixer-dev libconfuse-dev libenet-dev libsdl2-dev libxmp-dev libpng-dev
libepoxy-dev clang-${{ env.clang-version }} clang-tidy-${{ env.clang-version }}
clang-format-${{ env.clang-version }} fd-find
- name: Run clang-format style check
run: |
fdfind . -e .c -e .h -X clang-format-${{ env.clang-version }} --dry-run --Werror
- name: Build tests
run: |
cmake -DCMAKE_C_COMPILER=clang-${{ env.clang-version }} \
-DUSE_TIDY=On \
-DUSE_TESTS=On \
-DUSE_SANITIZERS=On \
-DUSE_FATAL_SANITIZERS=On \
-DUSE_TOOLS=On \
-DUSE_MINIUPNPC=Off \
-DUSE_NATPMP=Off \
-G "Ninja Multi-Config" \
-S . -B build-test
cmake --build build-test -j $(getconf _NPROCESSORS_ONLN)
- name: Run tests
run: |
cd build-test
ctest --verbose --output-on-failure
- name: Get OMF2097 assets
uses: ./.github/actions/assets
- name: Extract omf 2097 assets
run: unzip -j omf2097-assets.zip -d build-test/resources
- name: Install pytest requirements
run: |
pipx install poetry
poetry install
- name: Run pytest tests
run: ./run_pytest.sh build-test
# Build windows release artifacts with MSVC
# -----------------------------------------------------------------------------------------------
build_msvc:
needs: [unittest]
name: Build Windows ${{ matrix.config.arch }}
runs-on: windows-latest
strategy:
matrix:
config:
- { arch: "x64", build_languages: "ON" }
- { arch: "arm64", build_languages: "OFF" }
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build MSVC binary
uses: ./.github/actions/build_msvc
with:
arch: ${{ matrix.config.arch }}
build_languages: ${{ matrix.config.build_languages }}
# Build ubuntu package, release artifact
# -----------------------------------------------------------------------------------------------
build_ubuntu:
needs: [unittest]
name: Build ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build Ubuntu binary
uses: ./.github/actions/build_ubuntu
# Build macos package, release artifact
# -----------------------------------------------------------------------------------------------
build_macos-arm:
needs: [unittest]
name: Build macos-14
runs-on: macos-14
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build MacOS ARM binary
uses: ./.github/actions/build_macos_arm
# Build MinGW, just so we know it still compiles
# -----------------------------------------------------------------------------------------------
check_mingw:
needs: [unittest]
name: Check MinGW-w64 cross
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Build Mingw-w64 binary
uses: ./.github/actions/build_mingw
# Create a "latest" release
# -----------------------------------------------------------------------------------------------
make_release:
needs: [check_mingw, build_macos-arm, build_ubuntu, build_msvc]
if: github.ref == 'refs/heads/master'
name: Make "latest" release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
- name: Get OpenOMF Version
uses: ./.github/actions/version
- uses: actions/download-artifact@v4
with:
path: artifacts/
- name: Advance tag
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
try {
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "tags/latest"
})
} catch (e) {
console.log("The 'latest' tag doesn't exist yet", e)
}
try {
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: "refs/tags/latest",
sha: context.sha
})
} catch (e) {
console.log("Unable to create 'latest' tag", e)
}
- name: Organize release artifacts
shell: bash
run: |
mkdir upload
mkdir windows_all
combine_windows() {
if [ "$#" -ne 2 ]; then
echo "wrong argc to combine_windows"
exit 1
fi
unzip -d windows_all -o -u "$1"
rm "$1"
if [ "$2" != "openomf.exe" ]; then
mv "windows_all/openomf/openomf.exe" "windows_all/openomf/$2"
fi
}
combine_windows artifacts/openomf_*_windows_msvc_arm64/*.zip openomf_arm64.exe
combine_windows artifacts/openomf_*_windows_msvc_x64/*.zip openomf.exe
cd windows_all/
zip -r ${GITHUB_WORKSPACE}/upload/openomf_${{ env.OPENOMF_VERSION }}_windows.zip *
cd ..
shopt -s globstar
for file in artifacts/**; do
if [ -f "$file" ]; then
cp "$file" "${GITHUB_WORKSPACE}/upload/"
fi
done
- uses: ncipollo/release-action@v1
with:
artifacts: "upload/*"
body: "Latest release from master. Note that this is autogenerated release, and should only be used for testing purposes."
name: Latest
tag: latest
allowUpdates: true
prerelease: true
removeArtifacts: true
token: ${{ secrets.GITHUB_TOKEN }}