|
| 1 | +name: C/C++ CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [ "main" ] |
| 6 | + pull_request: |
| 7 | + branches: [ "main" ] |
| 8 | + |
| 9 | +jobs: |
| 10 | + build-and-test: |
| 11 | + strategy: |
| 12 | + fail-fast: false |
| 13 | + matrix: |
| 14 | + os: [windows-latest] |
| 15 | + build_type: [Release] |
| 16 | + runs-on: ${{ matrix.os }} |
| 17 | + env: |
| 18 | + BUILD_TYPE: ${{ matrix.build_type }} |
| 19 | + CTEST_OUTPUT_ON_FAILURE: 1 |
| 20 | + |
| 21 | + steps: |
| 22 | + - name: Checkout |
| 23 | + uses: actions/checkout@v4 |
| 24 | + |
| 25 | + - name: Config MSVC (Windows) |
| 26 | + if: runner.os == 'Windows' |
| 27 | + uses: ilammy/msvc-dev-cmd@v1 |
| 28 | + |
| 29 | + - name: Install ninja (Windows) |
| 30 | + if: runner.os == 'Windows' |
| 31 | + run: choco install -y ninja |
| 32 | + |
| 33 | + - name: Setup python |
| 34 | + uses: actions/setup-python@v4 |
| 35 | + with: |
| 36 | + python-version: '3.10.X' |
| 37 | + cache: 'pip' |
| 38 | + cache-dependency-path: '**/requirements.txt' |
| 39 | + |
| 40 | + - name: Install python dependencies |
| 41 | + run: | |
| 42 | + python -m pip install --upgrade pip setuptools wheel |
| 43 | + pip install -r requirements.txt |
| 44 | +
|
| 45 | + - name: Configure (Windows) |
| 46 | + if: runner.os == 'Windows' |
| 47 | + run: | |
| 48 | + cmake -S . -B build -G Ninja ` |
| 49 | + -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} ` |
| 50 | + -DBUILD_TESTING=ON ` |
| 51 | + -DBUILD_TESTS=ON ` |
| 52 | + -DPROXY_ENABLE_LOG=ON ` |
| 53 | + -DPROXY_LINK_MAP=ON ` |
| 54 | + -DBUILD_LOADER=ON |
| 55 | + |
| 56 | + - name: Build |
| 57 | + run: cmake --build build --config ${{ env.BUILD_TYPE }} -- -k 0 |
| 58 | + |
| 59 | + - name: Tests |
| 60 | + working-directory: build |
| 61 | + run: ctest -C ${{ env.BUILD_TYPE }} |
| 62 | + |
| 63 | + - name: Upload build & tests logs |
| 64 | + if: always() |
| 65 | + uses: actions/upload-artifact@v4 |
| 66 | + with: |
| 67 | + name: logs-${{ matrix.os }}-${{ env.BUILD_TYPE }} |
| 68 | + path: | |
| 69 | + build/Testing/Temporary/LastTest.log |
| 70 | + build/CMakeFiles/CMakeOutput.log |
| 71 | + build/CMakeFiles/CMakeError.log |
| 72 | + if-no-files-found: ignore |
0 commit comments