# Copyright (c) 2022-2025 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

regenerate plugin-api:
    interruptible: true
    stage: build
    extends: .linux-vm-shell-task
    before_script:
        - !reference [ .setup, script ]
        - cd arkoala-arkts/libarkts
        - npm run panda:sdk:install
    script:
        - npm run regenerate
    needs:
        - install node modules (arkoala-arkts)
        - install node modules (incremental)
        - install node modules (interop)

build plugin-api:
    interruptible: true
    stage: build
    extends: .linux-vm-shell-task
    before_script:
        - !reference [ .setup, script ]
        - cd arkoala-arkts/libarkts
        - npm run panda:sdk:install
        - npm run regenerate
    script:
        - npm run compile
    needs:
        - install node modules (arkoala-arkts)
        - install node modules (incremental)
        - install node modules (interop)
        - regenerate plugin-api

test plugin-api:
    interruptible: true
    stage: test
    extends: .linux-vm-shell-task
    before_script:
        - !reference [ .setup, script ]
        - cd arkoala-arkts/libarkts
        - npm run panda:sdk:install
        - npm run regenerate
    script:
        - npm run test
    needs:
        - install node modules (arkoala-arkts)
        - install node modules (incremental)
        - install node modules (interop)
        - regenerate plugin-api

test example arkts-plugin:
    interruptible: true
    stage: test
    extends: .linux-vm-shell-task
    before_script:
        - !reference [ .setup, script ]
        - cd arkoala-arkts/libarkts
        - npm run panda:sdk:install
        - npm run regenerate
    script:
        - npm run run
    needs:
        - install node modules (arkoala-arkts)
        - install node modules (incremental)
        - install node modules (interop)

test libarkts playground:
    interruptible: true
    stage: test
    extends: .linux-vm-shell-task
    before_script:
        - !reference [ .setup, script ]
        - cd arkoala-arkts/libarkts
        - npm run panda:sdk:install
        - npm run regenerate
    script:
        - npm run run:playground
    needs:
        - install node modules (arkoala-arkts)
        - install node modules (incremental)
        - install node modules (interop)
        - regenerate plugin-api