name: cpp-template
on:
  push:
  pull_request:
  tags:
    - v*
jobs:
  build:
    strategy:
      matrix:
        toolchain:
          - host.gcc
          - aarch64-linux-gnu
          - arm-linux-gnueabihf
          - mipsel-linux-gnu
        build_type: [Debug, Release]
    runs-on: ubuntu-22.04
    container:
      image: tqcq/aw-centos:8
    steps:
      - uses: actions/checkout@v4
      - name: build
        run: |
          mkdir -pv build && cd build
          cmake .. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAINS}/${{ matrix.toolchain }}.toolchain.cmake -DWITH_EXAMPLES=ON
          make -j`nproc`
