name: Compilation

on:
  push:
    branches:
      - master
  pull_request:
    branches:
      - master
      - develop
  workflow_dispatch:

jobs:
  nano_release_build:
    name: Build release application for NanoS, X and S+
    strategy:
      matrix:
        sdk: ["$NANOS_SDK", "$NANOX_SDK", "$NANOSP_SDK"]
    runs-on: ubuntu-latest
    container:
      image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest

    steps:
      - name: Clone
        uses: actions/checkout@v3

      - name: Build Ethereum
        run: |
          make -j BOLOS_SDK=${{ matrix.sdk }}

      - name: Build an altcoin
        run: |
          make clean
          make -j BOLOS_SDK=${{ matrix.sdk }} CHAIN=polygon
