name: RX65N-Cloud-Kit

on:
  push:
    branches: [ master ]
  pull_request:
    branches: [ master ]

defaults:
  run:
    working-directory: Renesas/RX65N_Cloud_Kit

jobs:
  build:
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        os: [ubuntu-latest]
        type: [Debug, Release]        

    steps:
      - name: Checkout code
        uses: actions/checkout@v2
        with:
          submodules: recursive

      - name: rx-elf-gcc
        uses: ryanwinter/rx-elf-gcc@main
        with:
          release: '8.3.0.202004'

      - name: Install Ninja
        uses: seanmiddleditch/gha-setup-ninja@v3

      - name: Build binary
        run: |
          cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE="../../cmake/renesas-rx-gcc-rx65n.cmake" -DCMAKE_BUILD_TYPE="${{ matrix.type }}"
          cmake --build build

