|
| 1 | +name: Build (Windows / macOS / Linux) |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +jobs: |
| 8 | + build: |
| 9 | + strategy: |
| 10 | + fail-fast: false |
| 11 | + matrix: |
| 12 | + os: [windows-latest, ubuntu-latest, macos-latest] |
| 13 | + |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + |
| 16 | + steps: |
| 17 | + # ---------------------------- |
| 18 | + # Checkout |
| 19 | + # ---------------------------- |
| 20 | + - name: Checkout repository |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + submodules: recursive # <--- ensures all submodules are cloned |
| 24 | + |
| 25 | + # ---------------------------- |
| 26 | + # Setup Conan |
| 27 | + # ---------------------------- |
| 28 | + - name: Setup Conan |
| 29 | + uses: conan-io/setup-conan@v1 |
| 30 | + with: |
| 31 | + version: latest |
| 32 | + cache_packages: true |
| 33 | + profile_detect: true |
| 34 | + audit_token: ${{ secrets.CONAN_AUDIT_TOKEN }} |
| 35 | + # Optional: config URLs |
| 36 | + # config_urls: | |
| 37 | + # https://github.com/<org>/conan-config.git |
| 38 | + |
| 39 | + # ---------------------------- |
| 40 | + # Install dependencies |
| 41 | + # ---------------------------- |
| 42 | + - name: Conan install |
| 43 | + run: conan install . --build=missing |
| 44 | + |
| 45 | + # ---------------------------- |
| 46 | + # Build |
| 47 | + # ---------------------------- |
| 48 | + - name: Configure & Build |
| 49 | + run: | |
| 50 | + if [ "${{ matrix.os }}" == "windows-latest" ]; then |
| 51 | + echo "Building on Windows using conan-default preset" |
| 52 | + cmake --build --preset conan-default |
| 53 | + else |
| 54 | + echo "Building on Linux/macOS using conan-release preset" |
| 55 | + cmake --preset conan-release |
| 56 | + cmake --build --preset conan-release |
| 57 | + fi |
| 58 | + shell: bash |
| 59 | + |
| 60 | + # ---------------------------- |
| 61 | + # Upload artifact |
| 62 | + # ---------------------------- |
| 63 | + - name: Upload artifact |
| 64 | + uses: actions/upload-artifact@v4 |
| 65 | + with: |
| 66 | + name: build-${{ matrix.os }} |
| 67 | + path: build/Release/ |
0 commit comments