name: backend-rknn

on:
  push:
    paths:
      - "csrc/**"
      - "demo/csrc/**"
      - "CMakeLists.txt"

  pull_request:
    paths-ignore:
      - "csrc/**"
      - "demo/csrc/**"
      - "CMakeLists.txt"

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

jobs:
  build_rknpu2:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          submodules: 'recursive'
      - name: update
        run: sudo apt update
      - name: cross compile
        run: |
          sh -xe tools/scripts/ubuntu_cross_build_rknn.sh rk3588
  build_rknpu:
    runs-on: ubuntu-20.04
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          submodules: 'recursive'
      - name: update
        run: sudo apt update
      - name: cross compile
        run: |
          sh -xe tools/scripts/ubuntu_cross_build_rknn.sh rv1126
