From a390a6859a8048795874a93d0411e80b3e7b8c45 Mon Sep 17 00:00:00 2001 From: marauder2k7 Date: Tue, 25 Jul 2023 21:09:27 +0100 Subject: [PATCH] add linux build test --- .../actions/upload-artifact/action.yml | 2 +- .github/workflows/build-linux-gcc.yml | 79 +++++++++++++++++++ .github/workflows/build-windows-msvc.yml | 19 ++++- 3 files changed, 95 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/build-linux-gcc.yml diff --git a/.github/workflows/actions/upload-artifact/action.yml b/.github/workflows/actions/upload-artifact/action.yml index c3765f868..9042dd1e4 100644 --- a/.github/workflows/actions/upload-artifact/action.yml +++ b/.github/workflows/actions/upload-artifact/action.yml @@ -11,7 +11,7 @@ inputs: runs: using: "composite" steps: - name: Upload Torque Test Report + - name: Upload Torque Test Report uses: actions/upload-artifact@v3 with: name: ${{inputs.name}} diff --git a/.github/workflows/build-linux-gcc.yml b/.github/workflows/build-linux-gcc.yml new file mode 100644 index 000000000..10ea6c1ae --- /dev/null +++ b/.github/workflows/build-linux-gcc.yml @@ -0,0 +1,79 @@ +name: Linux Build GCC +on: + push: + branches: [development] + pull_request: + branches: [development] +env: + build_type: "Release" + cc: "gcc" + cxx: "g++" + environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + run_tests: true + +concurrency: + group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows + cancel-in-progress: true +jobs: + build-linux: + if: github.repository == 'TorqueGameEngines/Torque3D' + name: Linux Ubuntu 20.04 GCC + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Print env + run: | + echo github.event.action: ${{ github.event.action }} + echo github.event_name: ${{ github.event_name }} + + - name: Setup GCC problem matcher + uses: ammaraskar/gcc-problem-matcher@master + + - name: Install Linux Dependencies + run: | + sudo apt-get update && \ + sudo apt-get install -y \ + build-essential \ + nasm \ + libogg-dev \ + libxft-dev \ + libx11-dev \ + libxxf86vm-dev \ + libopenal-dev \ + libfreetype6-dev \ + libxcursor-dev \ + libxinerama-dev \ + libxi-dev \ + libxrandr-dev \ + libxss-dev \ + libglu1-mesa-dev \ + libgtk-3-dev + + - name: Configure Build & Install + uses: ashutoshvarma/action-cmake-build@v1 + with: + build-dir: ${{github.workspace}}/build + # will set the CC & CXX for cmake + cc: ${{env.cc}} + cxx: ${{env.cxx}} + build-type: ${{env.build_type}} + # Extra options pass to cmake while configuring project + configure-options: -DTORQUE_APP_NAME=Torque3D -DTORQUE_TESTING=ON + # install the build using cmake --install + install-build: true + # run build using '-j [parallel]' to use multiple threads to build + parallel: 14 + + - name: Unit Tests + if: ${{env.run_tests}} + shell: bash + run: | + cd "${{github.workspace}}/My Projects/Torque3D/game" + ./Torque3D runTests.tscript + + - name: Upload Artifact + uses: ./.github/actions/upload-artifact + with: + name: torque3dWindowsMSVCUnitTest \ No newline at end of file diff --git a/.github/workflows/build-windows-msvc.yml b/.github/workflows/build-windows-msvc.yml index 32ff67d41..6786b7a47 100644 --- a/.github/workflows/build-windows-msvc.yml +++ b/.github/workflows/build-windows-msvc.yml @@ -9,7 +9,7 @@ env: cc: "cl" cxx: "cl" environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" - generators: "Visual Studio 17 2022" + run_tests: true concurrency: group: ci-${{github.actor}}-${{github.head_ref || github.run_number}}-${{github.ref}}-windows @@ -37,8 +37,8 @@ jobs: cmake --version cmd "${{env.environment_script}}" - - name: Build & Test - uses: ashutoshvarma/action-cmake-build@master + - name: Configure Build & Install + uses: ashutoshvarma/action-cmake-build@v1 with: build-dir: ${{github.workspace}}/build # will set the CC & CXX for cmake @@ -51,4 +51,15 @@ jobs: install-build: true # run build using '-j [parallel]' to use multiple threads to build parallel: 14 - \ No newline at end of file + + - name: Unit Tests + if: ${{env.run_tests}} + shell: bash + run: | + cd "${{github.workspace}}/My Projects/Torque3D/game" + ./Torque3D.exe runTests.tscript + + - name: Upload Artifact + uses: ./.github/actions/upload-artifact + with: + name: torque3dWindowsMSVCUnitTest \ No newline at end of file