OpenRCT2/.github/workflows/ci.yml

409 lines
15 KiB
YAML
Raw Normal View History

name: CI
on:
push:
paths-ignore:
- '.editorconfig'
- '.gitattributes'
- '.github/*_TEMPLATE/**'
- '.github/workflows/localisation.yml'
- '.gitignore'
- '.vscode/**'
pull_request:
paths-ignore:
- '.editorconfig'
- '.gitattributes'
- '.github/*_TEMPLATE/**'
- '.github/workflows/localisation.yml'
- '.gitignore'
- '.vscode/**'
2021-04-15 11:32:14 +02:00
defaults:
run:
shell: bash
2020-01-09 10:53:13 +01:00
env:
OPENRCT2_BUILD_SERVER: GitHub
2020-01-09 10:53:13 +01:00
OPENRCT2_ORG_TOKEN: ${{ secrets.OPENRCT2_ORG_TOKEN }}
BACKTRACE_IO_TOKEN: ${{ secrets.BACKTRACE_IO_TOKEN }}
Release v0.4.0 - Headline feature: [#10664] New save format with increased limits. - Feature: [#714] Allow up to 255 trains per ride. - Feature: [#2253] Path surfaces and railings can be mixed and matched, like in RCT1. - Feature: [#2766] The Fruity Ices Stall can now be recoloured, like in RCT1. - Feature: [#4933] Allow map sizes of 999 × 999 (up from 254 × 254). - Feature: [#7660] Custom music objects that are distributed with the save. - Feature: [#8407] Ride platforms can be made invisible. - Feature: [#12793] Add Excitement/Intensity/Nausea ratings to Ride List view with sorting. - Feature: [#13858] Flatride bases can be made invisible. - Feature: [#14676] [Plugin] Allow plugins to store data in .park files. - Feature: [#15367] Individual track elements can now be drawn as another ride type. - Feature: [#15901] [Plugin] Add ‘map.getAllEntitiesOnTile’ to API. - Feature: [#16029] [Plugin] Add ‘TrackElement.rideType’ to API. - Feature: [#16097] The Looping Roller Coaster can now draw all elements from the LIM Launched Roller Coaster. - Feature: [#16132, #16389] The Corkscrew, Twister and Vertical Drop Roller Coasters can now draw inline twists. - Feature: [#16144] [Plugin] Add ‘ImageManager’ to API. - Feature: [#16707] [Plugin] Implement intransient plugins. - Feature: [#16707] [Plugin] New API for current mode, ‘map.change’ hook and toolbox menu items on title screen. - Feature: [#16731] [Plugin] New API for fetching and manipulating a staff member’s patrol area. - Feature: [#16800] [Plugin] Add lift hill speed properties to API. - Feature: [#16806] Parkobj can load sprites from RCT image archives. - Feature: [#16831] Allow tertiary colours for small and large scenery objects. - Feature: [#16872] [Plugin] Add support for custom images. - Improved: [#3517] Cheats are now saved with the park. - Improved: [#10150] Ride stations are now properly checked if they’re sheltered. - Improved: [#10664, #16072] Visibility status can be modified directly in the Tile Inspector’s list. - Improved: [#16251] Plugin API handles null values better. - Improved: [#16251] openrct2.d.ts: mark ‘callback’ argument of queryAction and executeAction as optional. - Improved: [#16251] openrct2.d.ts: change ‘network.status’ to ‘network.mode’ in network API docs. - Improved: [#16251] openrct2.d.ts: added previously undocumented ‘GroupBoxWidget.text’ property. - Improved: [#16251] openrct2.d.ts: removed unused ‘LabelWidget.onChange’ property. - Improved: [#16258] Increased image limit in the engine. - Improved: [#16408] Improve ‘--version’ cli option to report more compatibility information. - Improved: [#16740] Allow staff patrol areas to be defined with individual tiles rather than groups of 4x4. - Improved: [#16764] [Plugin] Add hook ‘map.save’, called before the map is saved. - Improved: [#16925] The queue length of 1000 guests is lifted, and a warning for too long queues is added instead. - Change: [#14484] Make the Heartline Twister coaster ratings a little bit less hateful. - Change: [#16077] When importing SV6 files, the RCT1 land types are only added when they were actually used. - Change: [#16424] Following an entity in the title sequence no longer toggles underground view when it’s underground. - Change: [#16493] Boat Hire and Submarine Ride support costs now match their visual appearance. - Change: [#16710] Changed default view of Guest List to ‘Thoughts’ and selected tab will default to ‘Summarised’ (when opened from the menu). - Change: [#16859] Guests with umbrellas no longer always avoid going into a Maze. - Change: [#16912] Tired or nauseated guests will no longer jump in a Maze. - Fix: [#6767] Black screen after Alt-Tabbing back into the game. - Fix: [#11752] Track pieces with fractional cost are too cheap to build. - Fix: [#12556] Allow game to run without audio devices. - Fix: [#12774] [Plugin] Scripts will not be re-initialised when a new scenario is loaded from within a running scenario. - Fix: [#13336] Can no longer place Bumble Bee track design (reverts #12707). - Fix: [#14155] Map Generator sometimes places non-tree objects as trees. - Fix: [#14674] Recent Messages only shows first few notifications. - Fix: [#14920] Ghosts for rides and shops do not auto-elevate when obscured. - Fix: [#15413] Modifying park rating with plugins desyncs park rating history from actual park rating. - Fix: [#15571] Non-ASCII characters in scenario description get distorted while saving. - Fix: [#15830] Objects with RCT1 images are very glitchy if OpenRCT2 is not linked to an RCT1 install. - Fix: [#15909] Text can overflow in ‘Select ride design’ windows. - Fix: [#15947, #15960] Removing a flat ride results in an error message and duplicate structures. - Fix: [#15998] Cannot set map size to the actual maximum. - Fix: [#16007] Scenario Editor “Entry Price” appears to the right of the value field. - Fix: [#16008] Tile Inspector can select elements from last tile without reselecting it. - Fix: [#16024] Go-Karts with more than 32 vehicles do not colour themselves correctly. - Fix: [#16026] Newly created rides with “Disable vehicle limits” cheat always get 32 trains with 12 cars each. - Fix: [#16063] Object Selection preview for objects with glass is broken. - Fix: [#16075] Exporting track designs saves scenery in incorrect locations. - Fix: [#16087] The Looping Roller Coaster booster is now always drawn correctly. - Fix: [#16140] The ‘Follow this’ option is now disabled when the ride view is set to ‘overall’ or a station. - Fix: [#16162] Go Karts speeds are not correctly randomised, they only go very fast or very slow. - Fix: [#16188] Medium-size banked turns on the Twister and Vertical Roller Coaster have incorrect support placement (partly original bug). - Fix: [#16264, #16572] Placing saved track design crashes game. - Fix [#16308] Crash when trying to place down a ride on Android. - Fix: [#16327] Crash on malformed network packet. - Fix: [#16449] [Plugin] Viewport doesn't hide when switching tabs. - Fix: [#16450] Banner style not copied when using tile inspector. - Fix: [#16535] Entering construction mode unblocks all paths. - Fix: [#16542] “Same price throughout park” status not correctly imported for RCT1 saves. - Fix: [#16572] Crash when trying to place track designs. - Fix: [#16591] [Plugin] ‘setInterval’ and ‘setTimeout’ is not disposed when map unloads. - Fix: [#16711] [Plugin] ‘Car.rideObject’ overflowing with more than 256 ride types. - Fix: [#16779] Fix case where title music doesn't unmute properly. - Fix: [#16808] Incorrect track design serialisation causing vehicle object replacement. - Fix: [#16869] Soft Toy Stall cannot be recoloured, but shows a recolouring option anyway (original bug). - Fix: [#16995] Native Linux dialog windows do not open if the path contains single quotes. - Fix: [objects#165] Glitch when Bengal Tiger Cars go through a corner.
2022-04-25 19:21:38 +02:00
OPENRCT2_VERSION: 0.4.0
jobs:
lint-commit:
name: Lint Commit Message
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Lint Commit Messages
uses: wagoid/commitlint-github-action@v3
with:
configFile: .commitlint.json
2019-10-31 01:03:05 +01:00
check-code-formatting:
name: Check code formatting
runs-on: ubuntu-latest
container: openrct2/openrct2-build:4-format
defaults:
run:
shell: sh
2019-10-31 01:03:05 +01:00
steps:
- name: Checkout
uses: actions/checkout@v3
2019-10-31 01:03:05 +01:00
- name: Run clang-format
run: scripts/check-code-formatting
windows:
name: Windows
runs-on: windows-latest
needs: check-code-formatting
strategy:
fail-fast: false
matrix:
platform: [win32, x64]
env:
CONFIGURATION: Release
PLATFORM: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Git describe for shallow checkout
id: ghd
uses: proudust/gh-describe@v1
- name: Update GA environment
run: echo "OPENRCT2_DESCRIBE=${{ steps.ghd.outputs.describe }}" >> $GITHUB_ENV
2022-04-01 11:02:48 +02:00
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
- name: Build OpenRCT2
run: . scripts/setenv && build
- name: Build artifacts
run: |
. scripts/setenv -q
build-portable
build-symbols
build-installer -i
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v3
with:
name: OpenRCT2-${{ runner.os }}-${{ matrix.platform }}
path: artifacts
if-no-files-found: error
- name: Run Tests
2022-03-26 20:15:14 +01:00
if: matrix.platform != 'arm64'
run: . scripts/setenv -q && run-tests
- name: Upload artifacts (openrct2.org)
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
2022-03-09 21:53:23 +01:00
upload-build artifacts/openrct2-portable-*.zip "windows-portable-$PLATFORM" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
upload-build artifacts/openrct2-installer-*.exe "windows-installer-$PLATFORM" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
upload-build artifacts/openrct2-symbols-*.zip "windows-symbols-$PLATFORM" $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
upload-backtrace-symbols artifacts/openrct2-symbols-*.zip
else
echo 'Not going to push build'
fi
2020-01-10 00:26:33 +01:00
windows-mingw:
name: Windows (${{ matrix.platform_name }}) using mingw
2020-09-27 20:30:13 +02:00
runs-on: ubuntu-latest
needs: check-code-formatting
container: openrct2/openrct2-build:4-mingw
strategy:
fail-fast: false
matrix:
platform: [win32, NT5.1]
include:
- platform: win32
platform_name: win32
cache_key: windows-mingw
build_flags: -DBUILD_SHARED_LIBS=ON -DENABLE_SCRIPTING=OFF
- platform: NT5.1
platform_name: win32, NT5.1
cache_key: windows-mingw-nt51
build_flags: -DDISABLE_HTTP=Off -DENABLE_SCRIPTING=ON -DCMAKE_CXX_FLAGS="-Wno-error=cast-function-type -Wno-error=unused-function" -DSTATIC=on -DMINGW_TARGET_NT5_1=ON
2020-09-27 20:30:13 +02:00
steps:
- name: Checkout
uses: actions/checkout@v3
2021-02-09 12:58:23 +01:00
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.cache_key }}
2022-04-01 11:02:48 +02:00
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
2020-09-27 20:30:13 +02:00
- name: Build OpenRCT2
run: |
sudo su
cmake -B bin -G Ninja -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=Release -DDISABLE_IPO=on -DFORCE32=on ${{ matrix.build_flags }}
cd bin
2020-09-27 20:30:13 +02:00
ninja -k0
- name: Upload artifacts (CI)
if: matrix.platform == 'NT5.1'
uses: actions/upload-artifact@v3
2020-09-27 20:30:13 +02:00
with:
name: OpenRCT2-Windows-${{ matrix.platform }}
2020-09-27 20:30:13 +02:00
path: bin/openrct2.exe
if-no-files-found: error
2021-01-03 05:15:40 +01:00
macos-cmake:
name: macOS (${{ matrix.arch }}) using CMake
2021-01-03 05:15:40 +01:00
runs-on: macos-latest
needs: check-code-formatting
strategy:
fail-fast: false
matrix:
arch: [x64, arm64]
include:
- arch: x64
cache_key: macos-x64
# Note: only build/run tests on the native architecture of the CI agent
2022-03-09 21:21:59 +01:00
# GitHub macos-latest agents are currently all Intel
build_flags: -DARCH="x86_64" -DWITH_TESTS=on
run_tests: true
- arch: arm64
cache_key: macos-arm64
build_flags: -DARCH="arm64"
run_tests: false
2021-01-03 05:15:40 +01:00
steps:
- name: Checkout
uses: actions/checkout@v3
2021-02-10 22:35:04 +01:00
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ matrix.cache_key }}
2022-04-01 11:02:48 +02:00
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
2021-01-03 05:15:40 +01:00
- name: Build OpenRCT2
run: |
HOMEBREW_NO_ANALYTICS=1 brew install ninja
. scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=on ${{ matrix.build_flags }}
2021-01-03 05:15:40 +01:00
- name: Run Tests
if: ${{matrix.run_tests}}
2021-01-03 05:15:40 +01:00
run: . scripts/setenv -q && run-tests
- name: Build artifacts
run: |
. scripts/setenv
mkdir -p artifacts
mv bin/OpenRCT2.app artifacts
echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m"
cd artifacts
2021-03-21 23:42:19 +01:00
zip -rqy openrct2-macos.zip OpenRCT2.app
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v3
with:
name: OpenRCT2-${{ runner.os }}-${{ matrix.arch }}-cmake
path: artifacts/openrct2-macos.zip
if-no-files-found: error
macos-universal:
name: macOS universal app bundle
runs-on: macos-latest
needs: macos-cmake
steps:
- name: Checkout
uses: actions/checkout@v3
- name: download x64 app bundle
uses: actions/download-artifact@v3
with:
name: OpenRCT2-${{ runner.os }}-x64-cmake
path: macos_universal/x64
- name: download arm64 app bundle
uses: actions/download-artifact@v3
with:
name: OpenRCT2-${{ runner.os }}-arm64-cmake
path: macos_universal/arm64
- name: Make Universal app bundle
run: |
. scripts/setenv
cd macos_universal
unzip x64/openrct2-macos.zip -d x64
unzip arm64/openrct2-macos.zip -d arm64
create-macos-universal
- name: Create artifact
run: |
. scripts/setenv
mkdir -p artifacts
mv macos_universal/OpenRCT2-universal.app artifacts/OpenRCT2.app
echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m"
cd artifacts
zip -rqy openrct2-macos.zip OpenRCT2.app
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v3
with:
name: OpenRCT2-${{ runner.os }}-universal
2021-03-21 23:42:19 +01:00
path: artifacts/openrct2-macos.zip
if-no-files-found: error
- name: Upload artifacts (openrct2.org)
run: |
. scripts/setenv
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
2022-03-09 21:53:23 +01:00
upload-build artifacts/openrct2-macos.zip macos $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
else
2022-03-09 21:53:23 +01:00
echo 'Not going to push build'
fi
linux-portable:
name: Linux (${{ matrix.platform }}, ${{ matrix.distro }}, portable)
runs-on: ubuntu-latest
needs: check-code-formatting
container: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- platform: x86_64
distro: bionic
image: openrct2/openrct2-build:0.3.1-bionic
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- platform: x86_64
distro: focal
image: openrct2/openrct2-build:5-focal
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- platform: x86_64
distro: bullseye
image: openrct2/openrct2-build:5-bullseye
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- platform: i686
distro: bionic
image: openrct2/openrct2-build:0.3.1-bionic32
build_flags: -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -g -gz"
steps:
- name: Checkout
uses: actions/checkout@v3
2021-02-09 12:58:23 +01:00
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: linux-${{ matrix.platform }}-${{ matrix.distro }}
- name: Get pre-reqs
run: . scripts/setenv && get-discord-rpc
2022-04-01 11:02:48 +02:00
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build OpenRCT2
run: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON ${{ matrix.build_flags }}
- name: Build artifacts
run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-${{ runner.os }}-${{ matrix.distro }}-${{ matrix.platform }}.tar.gz bin/install/usr
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v3
with:
name: OpenRCT2-${{ runner.os }}-${{ matrix.distro }}-${{ matrix.platform }}
path: artifacts
if-no-files-found: error
- name: Run Tests
run: . scripts/setenv -q && run-tests
- name: Upload artifacts (openrct2.org)
if: matrix.distro == 'bionic' # Need to get openrct2.org updated before other distros can be enabled
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
2022-03-09 21:53:23 +01:00
upload-build artifacts/OpenRCT2-${{ runner.os }}-${{ matrix.distro }}-${{ matrix.platform }}.tar.gz linux-${{ matrix.platform }} $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
else
2022-03-09 21:53:23 +01:00
echo 'Not going to push build'
fi
linux-appimage:
name: Linux (x64, AppImage)
runs-on: ubuntu-latest
needs: check-code-formatting
container: openrct2/openrct2-build:0.3.1-bionic
steps:
- name: Checkout
uses: actions/checkout@v3
2021-02-09 12:58:23 +01:00
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: linux-appimage
- name: Get pre-reqs
run: . scripts/setenv -q && get-discord-rpc
- name: Build OpenRCT2
run: . scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release -DAPPIMAGE=ON -DOPENRCT2_USE_CCACHE=on
- name: Build AppImage
run: . scripts/setenv -q && build-appimage
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v3
with:
name: OpenRCT2-AppImage
path: artifacts
if-no-files-found: error
linux-flathub-beta:
name: Linux (Flathub beta channel)
if: github.repository == 'OpenRCT2/OpenRCT2' && github.ref == 'refs/heads/develop' && github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- name: Send dispatch event to OpenRCT2 Flathub repository
uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.OPENRCT2_FLATHUB_TOKEN }}
repository: flathub/io.openrct2.OpenRCT2
event-type: openrct2_develop_push
client-payload: '{ "commit": "${{ github.sha }}" }'
linux-docker:
name: Linux (docker)
needs: check-code-formatting
if: github.repository == 'OpenRCT2/OpenRCT2'
runs-on: ubuntu-latest
steps:
- name: Checkout image
uses: actions/checkout@v3
with:
repository: OpenRCT2/openrct2-docker
- name: Build image
run: docker build -t openrct2/openrct2-cli:develop develop/cli
- name: Push image
env:
OPENRCT2_DOCKER_USER: ${{ secrets.OPENRCT2_DOCKER_USER }}
OPENRCT2_DOCKER_PASS: ${{ secrets.OPENRCT2_DOCKER_PASS }}
run: |
OPENRCT2_BRANCH=$(echo "$GITHUB_REF" | sed 's/refs\/heads\///')
echo "Current branch is $OPENRCT2_BRANCH"
if [ "$OPENRCT2_BRANCH" = 'develop' ]; then
2022-03-09 21:53:23 +01:00
docker login -u "$OPENRCT2_DOCKER_USER" -p "$OPENRCT2_DOCKER_PASS"
docker push openrct2/openrct2-cli:develop
else
2022-03-09 21:53:23 +01:00
echo 'Image not pushed'
fi
linux-clang:
name: Linux (Debug, [http, network, OpenGL] disabled) using clang
runs-on: ubuntu-latest
needs: check-code-formatting
container: openrct2/openrct2-build:0.3.1-bionic
steps:
- name: Checkout
uses: actions/checkout@v3
2021-02-09 12:58:23 +01:00
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: linux-clang
2022-04-01 11:02:48 +02:00
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
- name: Build OpenRCT2
run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_NETWORK=ON -DDISABLE_HTTP=ON -DDISABLE_OPENGL=ON
2020-01-31 09:02:11 +01:00
android:
name: Android
runs-on: ubuntu-latest
needs: check-code-formatting
2021-12-15 23:25:53 +01:00
container: openrct2/openrct2-build:4-android
2020-01-31 09:02:11 +01:00
steps:
- name: Checkout
uses: actions/checkout@v3
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: android
2022-04-01 11:02:48 +02:00
- name: Install GCC problem matcher
uses: ammaraskar/gcc-problem-matcher@master
2020-01-31 09:02:11 +01:00
- name: Build OpenRCT2
run: |
. scripts/setenv
pushd src/openrct2-android
./gradlew app:assembleRelease
popd
mkdir -p artifacts
2021-12-18 00:03:38 +01:00
mv src/openrct2-android/app/build/outputs/apk/release/app-release.apk artifacts/openrct2-arm.apk
2020-01-31 09:02:11 +01:00
- name: Upload artifacts (CI)
uses: actions/upload-artifact@v3
2020-01-31 09:02:11 +01:00
with:
name: OpenRCT2-Android
path: artifacts
if-no-files-found: error
2020-02-01 17:47:49 +01:00
- name: Upload artifacts (openrct2.org)
run: |
. scripts/setenv -q
if [[ "$OPENRCT2_PUSH" == "true" ]]; then
2022-03-09 21:53:23 +01:00
upload-build artifacts/openrct2-arm.apk android-arm $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH
2020-02-01 17:47:49 +01:00
else
2022-03-09 21:53:23 +01:00
echo 'Not going to push build'
2020-02-01 17:47:49 +01:00
fi