name: CI on: [push, pull_request] env: OPENRCT2_BUILD_SERVER: GitHub OPENRCT2_ORG_TOKEN: ${{ secrets.OPENRCT2_ORG_TOKEN }} OPENRCT2_VERSION: 0.2.4 jobs: check-code-formatting: name: Check code formatting runs-on: ubuntu-latest container: image: openrct2/openrct2-build:0.2.4-format steps: - name: Checkout uses: actions/checkout@v1 - name: Run clang-format run: scripts/check-code-formatting windows: name: Windows runs-on: windows-latest strategy: fail-fast: false matrix: platform: [win32, x64] env: CONFIGURATION: Release PLATFORM: ${{ matrix.platform }} steps: - name: Checkout uses: actions/checkout@v1 - name: Build OpenRCT2 shell: bash run: . scripts/setenv && build - name: Build artifacts shell: bash run: | . scripts/setenv -q build-portable build-symbols build-installer -i - name: Upload artifacts (CI) uses: actions/upload-artifact@v1 with: name: "OpenRCT2-Windows-${{ matrix.platform }}" path: artifacts - name: Run Tests shell: bash run: . scripts/setenv -q && run-tests - name: Upload artifacts (openrct2.org) shell: bash run: | . scripts/setenv -q if [[ "$OPENRCT2_PUSH" == "true" ]]; then 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 else echo 'Not going to push build' fi macos: name: macOS runs-on: macos-latest steps: - name: Checkout uses: actions/checkout@v1 - name: Build OpenRCT2 run: | . scripts/setenv xcodebuild mkdir -p artifacts mv build/Release/OpenRCT2.app artifacts - name: Upload artifacts (CI) uses: actions/upload-artifact@v1 with: name: "OpenRCT2-macOS" path: artifacts - name: Upload artifacts (openrct2.org) run: | . scripts/setenv if [[ "$OPENRCT2_PUSH" == "true" ]]; then echo -e "\033[0;36mCompressing OpenRCT2.app...\033[0m" cd artifacts zip -rq openrct2-macos.zip OpenRCT2.app upload-build openrct2-macos.zip macos $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi linux-portable: name: Linux (x64, portable) runs-on: ubuntu-latest container: image: openrct2/openrct2-build:0.2.4-bionic steps: - name: Checkout uses: actions/checkout@v1 - name: Get pre-reqs shell: bash run: . scripts/setenv && get-discord-rpc - name: Build OpenRCT2 shell: bash run: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON -DCMAKE_CXX_FLAGS="-g -gz" - name: Build artifacts shell: bash run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-Linux-x86_64.tar.gz bin/install/usr - name: Upload artifacts (CI) uses: actions/upload-artifact@v1 with: name: "OpenRCT2-Linux-x86_64" path: artifacts - name: Run Tests shell: bash run: . scripts/setenv -q && run-tests - name: Upload artifacts (openrct2.org) shell: bash run: | . scripts/setenv -q if [[ "$OPENRCT2_PUSH" == "true" ]]; then upload-build artifacts/OpenRCT2-Linux-x86_64.tar.gz linux-x86_64 $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi linux-portable-32: name: Linux (i686, portable) runs-on: ubuntu-latest container: image: openrct2/openrct2-build:0.2.4-bionic32 steps: - name: Checkout uses: actions/checkout@v1 - name: Get pre-reqs shell: bash run: . scripts/setenv && get-discord-rpc - name: Build OpenRCT2 shell: bash env: TESTPAINT: true run: . scripts/setenv -q && build -DWITH_TESTS=on -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=ON -DPORTABLE=ON -DFORCE32=ON -DCMAKE_CXX_FLAGS="-m32 -gz" - name: Build artifacts shell: bash run: . scripts/setenv -q && build-portable artifacts/OpenRCT2-Linux-i686.tar.gz bin/install/usr - name: Upload artifacts (CI) uses: actions/upload-artifact@v1 with: name: "OpenRCT2-Linux-i686" path: artifacts - name: Run Tests shell: bash run: . scripts/setenv -q && run-tests - name: Run testpaint shell: bash run: . scripts/setenv -q && run-testpaint - name: Upload artifacts (openrct2.org) shell: bash run: | . scripts/setenv -q if [[ "$OPENRCT2_PUSH" == "true" ]]; then upload-build artifacts/OpenRCT2-Linux-i686.tar.gz linux-i686 $OPENRCT2_VERSION $OPENRCT2_SHA1 $OPENRCT2_BRANCH else echo 'Not going to push build' fi linux-appimage: name: Linux (x64, AppImage) runs-on: ubuntu-latest container: image: openrct2/openrct2-build:0.2.4-bionic steps: - name: Checkout uses: actions/checkout@v1 - name: Get pre-reqs shell: bash run: . scripts/setenv -q && get-discord-rpc - name: Build OpenRCT2 shell: bash env: DESTDIR: AppDir run: . scripts/setenv -q && build -DCMAKE_BUILD_TYPE=Release - name: Build AppImage shell: bash run: . scripts/setenv -q && build-appimage - name: Upload artifacts (CI) uses: actions/upload-artifact@v1 with: name: OpenRCT2-AppImage path: artifacts linux-clang: name: Linux (Debug, [http, network, OpenGL] disabled) using clang runs-on: ubuntu-latest container: image: openrct2/openrct2-build:0.2.4-bionic steps: - name: Checkout uses: actions/checkout@v1 - name: Build OpenRCT2 shell: bash run: . scripts/setenv && build -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Debug -DDISABLE_NETWORK=ON -DDISABLE_HTTP_TWITCH=ON -DDISABLE_OPENGL=ON