# Gitea Actions workflow (GitHub Actions–compatible schema).
# Root `azure-pipelines.yml` remains for Azure DevOps; this file runs on Gitea Actions.
#
# `runs-on` must match a label on an online runner (Admin → Actions → Runners).
# Current runner labels are: ubuntu-latest, ubuntu-22.04, ubuntu-20.04.
# Keep `runs-on` aligned with one of those labels.

name: Performics DevOps

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

env:
  NODE_VERSION: '22'

jobs:
  build-and-test:
    name: Performics DevOps Pipeline
    runs-on: ubuntu-22.04
    steps:
      - uses: actions/checkout@v4

      - uses: actions/setup-node@v4
        with:
          node-version: ${{ env.NODE_VERSION }}

      - name: Diagnostics
        run: |
          set -euo pipefail
          node -v
          npm -v
          pwd

      - name: npm ci
        run: |
          set -euo pipefail
          npm ci

      - name: Android assembleRelease
        run: |
          set -euo pipefail
          cd android
          ./gradlew assembleRelease
