mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-27 10:11:48 -04:00
67 lines
2.1 KiB
YAML
67 lines
2.1 KiB
YAML
name: Pull Request CI
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [ main, develop ]
|
|
paths-ignore:
|
|
- '**.md'
|
|
- 'docs/**'
|
|
- '.gitignore'
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
# 1. CHANGE DETECTION: Prevents unnecessary builds
|
|
check-changes:
|
|
if: github.repository == 'meshtastic/Meshtastic-Android' && !( github.head_ref == 'scheduled-updates' || github.head_ref == 'l10n_main' )
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
android: ${{ steps.filter.outputs.android }}
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dorny/paths-filter@v3
|
|
id: filter
|
|
with:
|
|
filters: |
|
|
android:
|
|
- 'app/**'
|
|
- 'core/**'
|
|
- 'feature/**'
|
|
- 'build-logic/**'
|
|
- 'build.gradle.kts'
|
|
- 'gradle.properties'
|
|
|
|
# 2. VALIDATION & BUILD: Delegate to reusable-check.yml
|
|
# We disable instrumented tests for PRs to keep feedback fast (< 10 mins).
|
|
validate-and-build:
|
|
needs: check-changes
|
|
if: needs.check-changes.outputs.android == 'true'
|
|
uses: ./.github/workflows/reusable-check.yml
|
|
with:
|
|
run_lint: true
|
|
run_unit_tests: true
|
|
run_instrumented_tests: false
|
|
api_levels: '[35]'
|
|
upload_artifacts: true
|
|
secrets: inherit
|
|
|
|
# 3. WORKFLOW STATUS: Ensures required checks are satisfied
|
|
check-workflow-status:
|
|
name: Check Workflow Status
|
|
runs-on: ubuntu-latest
|
|
needs: [check-changes, validate-and-build]
|
|
if: always()
|
|
steps:
|
|
- name: Check Workflow Status
|
|
run: |
|
|
# If changes were detected but build failed, fail the status check
|
|
if [[ "${{ needs.check-changes.outputs.android }}" == "true" && ("${{ needs.validate-and-build.result }}" == "failure" || "${{ needs.validate-and-build.result }}" == "cancelled") ]]; then
|
|
echo "::error::Android Check failed"
|
|
exit 1
|
|
fi
|
|
|
|
# If no changes were detected, this still succeeds to satisfy required status check
|
|
echo "Workflow status satisfied."
|