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.1 - Feature: [#16825] Add Alpine Coaster track type. - Feature: [#17011] Option to show ride vehicles as separate entries when selecting a ride to construct. - Feature: [#17217] Add FLAC and OGG/vorbis as supported audio formats for ride music objects. - Feature: [#12328, #17418] Add vehicles for the Hybrid Coaster, Single-Rail Roller Coaster and Classic Mini Roller Coaster. - Improved: [#7983] The red colour in the ride stat screen and the ride graphs now corresponds better to negative effects on a ride’s stats. - Improved: [#13966] Music Style dropdown is now sorted by name. - Improved: [#16978] Tree placement is more natural during map generation. - Improved: [#16992] The checkbox in the visibility column of the Tile Inspector has been replaced with an eye symbol. - Improved: [#16999] The maximum price for the park entry has been raised to £999. - Improved: [#17050] Transparency can be enabled directly without needing see-through enabled first. - Improved: [#17059] Show Tile Inspector usage hint when nothing is selected. - Improved: [#17199] Allow creation of Spiral Slide reskins. - Improved: [#17242] More natural looking shorelines in map generator. - Improved: [#17328] Parks can now be resized into rectangular shapes from the map and map generation windows. - Change: [#16952] Make “Object Selection” order more coherent. - Change: [#17002] Weather no longer resets when converting a save to scenario. - Change: [#17294] New ride window remembers scroll position per tab instead of highlighted ride. - Removed: [#16864] Title sequence editor (replaced by plug-in). - Removed: [#16911, #17411] Residual support for pre-Vista Windows systems. - Fix: [#13997] Placing a track design interferes with other players building a ride. - Fix: [#15787] When deselecting "Show banner text in upper case", the banners remain upper case for 10 seconds. - Fix: [#16539] CustomListView header not clickable when listview is scrolled. - Fix: [#16799] Browsing “Up” in the Load Save window shows no files, only folders. - Fix: [#16934] Park size displayed incorrectly in Park window. - Fix: [#16974] Small scenery ghosts can be deleted. - Fix: [#16989] Re-focusing maximised window triggers a restore and maximise. - Fix: [#17005] Unable to set patrol area for first staff member in park. - Fix: [#17017] [Plugin] Crash when using tile element properties that require a valid ride to be linked. - Fix: [#17073] Corrupt ride window and random crashes when trains have more than 144 cars. - Fix: [#17080] “Remove litter” cheat does not empty litter bins. - Fix: [#17099] Object selection thumbnail box is one pixel too tall. - Fix: [#17104] Changing map size does not invalidate park size. - Fix: [#17157] Crash when browsing “Up” to folder with CJK characters in its name. - Fix: [#17187] Text input window does not resize correctly. - Fix: [#17197] Segfault when extracting files from the GOG installer. - Fix: [#17205] Map generator sometimes crashes when not all standard terrain objects are available. - Fix: [#17221] Object ghosts and tooltips follow invisible cursor when moving the viewport by right-click dragging. - Fix: [#17255] Cursor position is incorrect when adjusting terrain and water height. - Fix: [#17257] [Plugin] Add tertiary colour to large scenery scripting API. - Fix: [#17261] Hand cursor position is incorrect when dragging items in the Inventions List window. - Fix: [#17292] Rows in shortcut key list stay highlighted when cursor leaves list. - Fix: [#17295] Pause status not cleared when loading a scenario made from a converted paused save. - Fix: [#17310] Reversed reversible vehicles not imported properly when loading RCT1 parks. - Fix: [#17335] [Plugin] Documentation has an incorrect type for PixelData ‘data’ attribute. - Fix: [#17337] Air Powered Vertical Coaster trains not imported properly when loading RCT1 parks. - Fix: [#17346] Surface height markers are concealed by sprites of same surface. - Fix: [#17369] [Plugin] ‘Car.travelBy()’ moves other cars as well. - Fix: [#17377] When building the park entrance before opening the Footpaths window, the path will be invisible. - Fix: [#17381] Air Powered Vertical Coaster stat penalty is wrong. - Fix: [#17399] Guests never generate the being watched thought. - Fix: [#17433] Wrong T-shirt colours for guests on a Twist ride. - Fix: [#17450] Ducks can swim on three-corners-up land tile. - Fix: [#17461] Footpath Railing tooltip showing incorrect tooltip. - Fix: [#17464] Green Tarmac footpath is not available in the Track Designer. - Fix: [#17466] New object types not packed in save files. - Fix: [#17481] Roto-drop cars try going up to top pieces that are ghosts or belong to other rides.
2022-07-04 18:53:36 +02:00
OPENRCT2_VERSION: 0.4.1
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:8-mingw
strategy:
fail-fast: false
matrix:
platform: [win32]
include:
- platform: win32
platform_name: win32
cache_key: windows-mingw
build_flags: -DBUILD_SHARED_LIBS=ON -DENABLE_SCRIPTING=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:4-bionic
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz" -DWITH_TESTS=off -DDISABLE_FLAC=ON -DDISABLE_VORBIS=ON
- platform: x86_64
distro: focal
image: openrct2/openrct2-build:8-focal
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- platform: x86_64
distro: jammy
image: openrct2/openrct2-build:8-jammy
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- platform: x86_64
distro: bullseye
image: openrct2/openrct2-build:8-bullseye
build_flags: -DCMAKE_POSITION_INDEPENDENT_CODE=on -DCMAKE_CXX_FLAGS="-g -gz"
- platform: i686
2022-05-22 23:42:17 +02:00
distro: focal
image: openrct2/openrct2-build:8-focal32
2022-05-09 23:25:30 +02:00
build_flags: -DFORCE32=ON -DENABLE_SCRIPTING=OFF -DCMAKE_CXX_FLAGS="-m32 -g -gz" -DWITH_TESTS=off
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)
run: |
# Build identification code: https://github.com/Limetric/OpenRCT2.org/blob/e5b738f3dadcc5a3b78e8dfd434756ff31eaa1d3/src/misc/releaseAsset.js#L94-L116
. 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
2022-05-21 00:17:39 +02:00
container: openrct2/openrct2-build:8-focal
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, flac, vorbis OpenGL] disabled) using clang
runs-on: ubuntu-latest
needs: check-code-formatting
2022-05-21 00:17:39 +02:00
container: openrct2/openrct2-build:8-jammy
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_FLAC=ON -DDISABLE_VORBIS=ON -DDISABLE_OPENGL=ON
2020-01-31 09:02:11 +01:00
android:
name: Android
runs-on: ubuntu-latest
needs: check-code-formatting
2022-05-21 00:17:39 +02:00
container: openrct2/openrct2-build:8-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