name: Validate env: VCPKG_VERSION: 2023.07.21 XMAKE_VERSION: 2.8.2 # 2.8.3 breaks fetching of asio package on MacOS ARM WINDOWS_SDK_VERSION: 22621 on: pull_request: types: [opened, reopened, synchronize] branches: [ main ] paths-ignore: - 'VERSION.txt' - 'CHANGELOG.md' push: branches: [ main ] paths-ignore: - 'VERSION.txt' - 'CHANGELOG.md' - '.github/workflows/create_release.yml' jobs: cancel-old-build: name: Cancel previous builds runs-on: [self-hosted, linux, x64] steps: - name: Cancel Previous Runs if: ${{ github.ref_name != 'main'}} uses: styfle/cancel-workflow-action@0.11.0 with: access_token: ${{ github.token }} clang-format: needs: cancel-old-build name: Check clang-format runs-on: [self-hosted, linux, x64] steps: - uses: actions/checkout@v3 - name: clang-format uses: jidicula/clang-format-action@v4.9.0 with: clang-format-version: '13' check-path: 'src' windows-build: needs: cancel-old-build name: Build & Test Windows runs-on: [self-hosted, windows, x64] timeout-minutes: 25 strategy: matrix: config: - 'debug' - 'release' arch: - 'x64' steps: - name: Checkout uses: actions/checkout@v3 - name: Setup xmake uses: xmake-io/github-action-setup-xmake@v1 with: xmake-version: ${{env.XMAKE_VERSION}} - name: Installing vcpkg run: | # Remove-Item -Recurse .vcpkg git clone -b ${{env.VCPKG_VERSION}} --single-branch https://github.com/Microsoft/vcpkg.git .vcpkg cd .vcpkg .\bootstrap-vcpkg.bat .\vcpkg.exe integrate install cd .. - name: Config run: | xmake config -v -y -m ${{ matrix.config }} --arch=${{ matrix.arch }} env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Build & Test if: ${{ matrix.config == 'debug' }} run: | xmake test -v -y --junit env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Upload report if: ${{ (failure() || success()) && (matrix.config == 'debug') }} uses: actions/upload-artifact@v3 with: name: reports-win64 path: build/reports/*.xml - name: Bundle if: ${{ matrix.config == 'release' }} run: | xmake bundle -v -y --codesignidentity="Epic Games" env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Upload zenserver-win64 if: ${{ github.ref_name == 'main' && matrix.config == 'release' }} uses: actions/upload-artifact@v3 with: name: zenserver-win64 path: build/zenserver-win64.zip linux-build: needs: cancel-old-build name: Build & Test Linux runs-on: [self-hosted, linux, x64] timeout-minutes: 25 strategy: matrix: config: - 'debug' - 'release' arch: - 'x86_64' steps: - name: Checkout uses: actions/checkout@v3 - name: Install UE Toolchain run: | rm -rf ./.tmp-ue-toolchain ./scripts/ue_build_linux/get_ue_toolchain.sh ./.tmp-ue-toolchain - name: Setup xmake uses: xmake-io/github-action-setup-xmake@v1 with: xmake-version: ${{env.XMAKE_VERSION}} - name: Installing vcpkg run: | # rm -rf .vcpkg git clone -b ${{env.VCPKG_VERSION}} --single-branch https://github.com/Microsoft/vcpkg.git .vcpkg cd .vcpkg ./bootstrap-vcpkg.sh cd .. - name: Config run: | ./scripts/ue_build_linux/ue_build.sh ./.tmp-ue-toolchain xmake config -v -y -m ${{ matrix.config }} --arch=${{ matrix.arch }} env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Build & Test if: ${{ matrix.config == 'debug' }} run: | ./scripts/ue_build_linux/ue_build.sh ./.tmp-ue-toolchain xmake test -v -y --junit env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Upload report if: ${{ (failure() || success()) && (matrix.config == 'debug') }} uses: actions/upload-artifact@v3 with: name: reports-linux path: build/reports/*.xml - name: Bundle if: ${{ matrix.config == 'release' }} run: | ./scripts/ue_build_linux/ue_build.sh ./.tmp-ue-toolchain xmake bundle -v -y env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Upload zenserver-linux if: ${{ github.ref_name == 'main' && matrix.config == 'release' }} uses: actions/upload-artifact@v3 with: name: zenserver-linux path: build/zenserver-linux.zip macos-build: needs: cancel-old-build name: Build & Test MacOS runs-on: [self-hosted, macos, x64] timeout-minutes: 15 strategy: matrix: config: - 'debug' - 'release' arch: - 'x86_64' steps: - name: Checkout uses: actions/checkout@v3 - name: Setup xmake uses: xmake-io/github-action-setup-xmake@v1 with: xmake-version: ${{env.XMAKE_VERSION}} - name: Installing vcpkg run: | # rm -rf .vcpkg git clone -b ${{env.VCPKG_VERSION}} --single-branch https://github.com/Microsoft/vcpkg.git .vcpkg cd .vcpkg ./bootstrap-vcpkg.sh cd .. - name: Config run: | xmake config -v -y -m ${{ matrix.config }} --arch=${{ matrix.arch }} env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Build & Test if: ${{ matrix.config == 'debug' }} run: | xmake test -v -y --junit env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Upload report if: ${{ (failure() || success()) && (matrix.config == 'debug') }} uses: actions/upload-artifact@v3 with: name: reports-macos path: build/reports/*.xml - name: Bundle if: ${{ matrix.config == 'release' }} run: | xmake bundle -v -y --codesignidentity="Developer ID Application" env: VCPKG_ROOT: ${{ github.workspace }}/.vcpkg - name: Upload zenserver-macos if: ${{ github.ref_name == 'main' && matrix.config == 'release' }} uses: actions/upload-artifact@v3 with: name: zenserver-macos path: build/zenserver-macos.zip