name: RSK-RX65N-2MB

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

defaults:
  run:
    working-directory: Renesas/RSK_RX65N_2MB

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
