|
| 1 | +# ref: https://github.com/actions/runner-images |
| 2 | +name: amd64 MacOS Bazel |
| 3 | + |
| 4 | +on: [push, pull_request, workflow_dispatch] |
| 5 | + |
| 6 | +# Building using the github runner environement directly. |
| 7 | +jobs: |
| 8 | + native: |
| 9 | + strategy: |
| 10 | + matrix: |
| 11 | + bazel: [ |
| 12 | + {compilation_mode: opt}, |
| 13 | + {compilation_mode: dbg}, |
| 14 | + ] |
| 15 | + cpp: [ |
| 16 | + #{version: 14, flags: "-std=c++14"}, |
| 17 | + {version: 17, flags: "-std=c++17"}, |
| 18 | + #{version: 20, flags: "-std=c++20"}, |
| 19 | + ] |
| 20 | + python: [ |
| 21 | + #{version: '3.11'}, |
| 22 | + {version: '3.12'}, |
| 23 | + ] |
| 24 | + exclude: |
| 25 | + # only test `-c dbg` build with C++17 |
| 26 | + - cpp: {version: 14} |
| 27 | + bazel: {compilation_mode: dbg} |
| 28 | + - cpp: {version: 20} |
| 29 | + bazel: {compilation_mode: dbg} |
| 30 | + fail-fast: false |
| 31 | + name: MacOS•Bazel(${{ matrix.bazel.compilation_mode }})•C++${{ matrix.cpp.version }}•Python${{ matrix.python.version }} |
| 32 | + runs-on: macos-13 # last macos intel based runner |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v4 |
| 35 | + - name: Set Java to OpenJDK 17 (Temurin) |
| 36 | + uses: actions/setup-java@v3 |
| 37 | + with: |
| 38 | + distribution: 'temurin' |
| 39 | + java-version: '17' |
| 40 | + - name: Setup Python |
| 41 | + uses: actions/setup-python@v5 |
| 42 | + with: |
| 43 | + python-version: ${{ matrix.python.version }} |
| 44 | + - name: Check Python |
| 45 | + run: | |
| 46 | + python --version |
| 47 | + python -m platform |
| 48 | + - name: Check Bazel |
| 49 | + run: bazel version |
| 50 | + - name: Change Python in MODULE.bazel |
| 51 | + run: | |
| 52 | + sed -i '' -e 's/\(DEFAULT_PYTHON =\) "3.[0-9]*"/\1 "${{ matrix.python.version }}"/g' MODULE.bazel |
| 53 | + cat MODULE.bazel |
| 54 | + - name: Build |
| 55 | + run: > |
| 56 | + bazel build |
| 57 | + -c ${{ matrix.bazel.compilation_mode }} |
| 58 | + --cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }} |
| 59 | + --subcommands=pretty_print |
| 60 | + --enable_bzlmod |
| 61 | + //... |
| 62 | + - name: Test |
| 63 | + run: > |
| 64 | + bazel test |
| 65 | + -c ${{ matrix.bazel.compilation_mode }} |
| 66 | + --cxxopt=${{ matrix.cpp.flags }} --host_cxxopt=${{ matrix.cpp.flags }} |
| 67 | + --subcommands=pretty_print |
| 68 | + --enable_bzlmod |
| 69 | + //... |
| 70 | +
|
| 71 | + amd64_macos_bazel: |
| 72 | + runs-on: ubuntu-latest |
| 73 | + needs: native |
| 74 | + steps: |
| 75 | + - uses: actions/checkout@v4 |
0 commit comments