implement weapon projectile (#8) #4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [ "main", "develop" ] | |
| pull_request: | |
| branches: [ "main" ] | |
| permissions: | |
| contents: read | |
| env: | |
| BUILD_TYPE: Release | |
| jobs: | |
| build-linux: | |
| name: Build (Linux) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| compiler: [gcc, clang] | |
| include: | |
| - compiler: gcc | |
| cc: gcc-12 | |
| cxx: g++-12 | |
| - compiler: clang | |
| cc: clang-15 | |
| cxx: clang++-15 | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| cmake \ | |
| ninja-build \ | |
| libssl-dev \ | |
| zlib1g-dev \ | |
| ${{ matrix.compiler == 'clang' && 'clang-15' || '' }} | |
| - name: Configure CMake | |
| env: | |
| CC: ${{ matrix.cc }} | |
| CXX: ${{ matrix.cxx }} | |
| run: | | |
| cmake -B build \ | |
| -G Ninja \ | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} \ | |
| -DENABLE_TELEMETRY=ON \ | |
| -DENABLE_SCRIPTING=OFF \ | |
| -DENABLE_COMPRESSION=ON \ | |
| -DBUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --parallel $(nproc) | |
| - name: Run tests | |
| working-directory: build | |
| run: ctest --output-on-failure --timeout 120 | |
| - name: Upload build artifact | |
| if: matrix.compiler == 'gcc' | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rs2v-server-linux | |
| path: build/rs2v_server | |
| retention-days: 7 | |
| build-windows: | |
| name: Build (Windows) | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build ` | |
| -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` | |
| -DENABLE_TELEMETRY=ON ` | |
| -DENABLE_SCRIPTING=OFF ` | |
| -DENABLE_COMPRESSION=ON ` | |
| -DBUILD_TESTS=ON | |
| - name: Build | |
| run: cmake --build build --config ${{ env.BUILD_TYPE }} --parallel | |
| - name: Run tests | |
| working-directory: build | |
| run: ctest -C ${{ env.BUILD_TYPE }} --output-on-failure --timeout 120 | |
| - name: Upload build artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: rs2v-server-windows | |
| path: build/${{ env.BUILD_TYPE }}/rs2v_server.exe | |
| retention-days: 7 | |
| static-analysis: | |
| name: Static Analysis | |
| runs-on: ubuntu-latest | |
| needs: build-linux | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Install cppcheck | |
| run: sudo apt-get update && sudo apt-get install -y cppcheck | |
| - name: Run cppcheck | |
| run: | | |
| cppcheck \ | |
| --enable=warning,performance,portability \ | |
| --suppress=missingIncludeSystem \ | |
| --inline-suppr \ | |
| --error-exitcode=1 \ | |
| -I src/ -I include/ -I telemetry/ \ | |
| --std=c++17 \ | |
| src/ telemetry/ | |
| docker: | |
| name: Docker Build | |
| runs-on: ubuntu-latest | |
| needs: build-linux | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . | |
| push: false | |
| tags: rs2v-server:${{ github.sha }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max |