|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +jobs: |
| 11 | + # Unified build on default GitHub runners |
| 12 | + build: |
| 13 | + name: Build (${{ matrix.os }}) |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + strategy: |
| 16 | + fail-fast: false |
| 17 | + matrix: |
| 18 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 19 | + steps: |
| 20 | + - name: Checkout |
| 21 | + uses: actions/checkout@v4 |
| 22 | + - name: Build and Test |
| 23 | + shell: bash |
| 24 | + run: | |
| 25 | + ./test.sh |
| 26 | +
|
| 27 | + # Examples on all default runners |
| 28 | + examples: |
| 29 | + name: Examples (${{ matrix.os }}) |
| 30 | + runs-on: ${{ matrix.os }} |
| 31 | + strategy: |
| 32 | + fail-fast: false |
| 33 | + matrix: |
| 34 | + os: [ubuntu-latest, macos-latest, windows-latest] |
| 35 | + steps: |
| 36 | + - name: Checkout |
| 37 | + uses: actions/checkout@v4 |
| 38 | + - name: Ensure git present (Linux) |
| 39 | + if: ${{ runner.os == 'Linux' }} |
| 40 | + run: | |
| 41 | + sudo apt-get update && sudo apt-get install -y --no-install-recommends git |
| 42 | + - name: Build and run examples (Linux/macOS) |
| 43 | + if: ${{ runner.os != 'Windows' }} |
| 44 | + shell: bash |
| 45 | + run: | |
| 46 | + set -e |
| 47 | + cd examples/c-tasks && ./build.sh |
| 48 | + build/objectbox-examples-c-tasks "Buy raspberries" |
| 49 | + build/objectbox-examples-c-tasks |
| 50 | + cd ../c-tasks-lowlevel && ./build.sh |
| 51 | + build/objectbox-examples-c-tasks-lowlevel "Buy blueberries" |
| 52 | + build/objectbox-examples-c-tasks-lowlevel |
| 53 | + cd ../tasks && ./build.sh |
| 54 | + printf "new \"Buy apples\"\nls\nexit" | build/objectbox-examples-tasks |
| 55 | + cd ../tasks-sync && ./build.sh || true |
| 56 | + if [ -x build/objectbox-examples-tasks-sync ]; then printf "new \"Buy bananas\"\nls\nexit" | build/objectbox-examples-tasks-sync; fi |
| 57 | + cd ../vectorsearch-cities && ./build.sh |
| 58 | + printf "name berlin\nexit" | build/objectbox-examples-vectorsearch-cities |
| 59 | + - name: Build and run examples (Windows) |
| 60 | + if: ${{ runner.os == 'Windows' }} |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + set -e |
| 64 | + cd examples/c-tasks && ./build.sh |
| 65 | + build/objectbox-examples-c-tasks "Buy raspberries" || build/Debug/objectbox-examples-c-tasks.exe "Buy raspberries" |
| 66 | + build/objectbox-examples-c-tasks || build/Debug/objectbox-examples-c-tasks.exe |
| 67 | + cd ../c-tasks-lowlevel && ./build.sh |
| 68 | + build/objectbox-examples-c-tasks-lowlevel "Buy blueberries" || build/Debug/objectbox-examples-c-tasks-lowlevel.exe "Buy blueberries" |
| 69 | + build/objectbox-examples-c-tasks-lowlevel || build/Debug/objectbox-examples-c-tasks-lowlevel.exe |
| 70 | + cd ../tasks && ./build.sh |
| 71 | + printf "new \"Buy apples\"\nls\nexit" | build/objectbox-examples-tasks || printf "new \"Buy apples\"\nls\nexit" | build/Debug/objectbox-examples-tasks.exe |
| 72 | + cd ../tasks-sync && ./build.sh || true |
| 73 | + if [ -x build/objectbox-examples-tasks-sync ]; then printf "new \"Buy bananas\"\nls\nexit" | build/objectbox-examples-tasks-sync; elif [ -x build/Debug/objectbox-examples-tasks-sync.exe ]; then printf "new \"Buy bananas\"\nls\nexit" | build/Debug/objectbox-examples-tasks-sync.exe; fi |
| 74 | + cd ../vectorsearch-cities && ./build.sh |
| 75 | + printf "name berlin\nexit" | build/objectbox-examples-vectorsearch-cities || printf "name berlin\nexit" | build/Debug/objectbox-examples-vectorsearch-cities.exe |
0 commit comments