MOEN-30953: CI Implemenation #9
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Verify Pull Request | |
on: | |
workflow_dispatch: # manual trigger | |
pull_request: | |
types: [ opened, reopened, ready_for_review, synchronize ] | |
branches: [ "development", "master" ] | |
jobs: | |
verify: | |
timeout-minutes: 30 | |
runs-on: ubuntu-latest | |
concurrency: | |
group: ${{ github.head_ref }}-${{ github.event_name }} | |
cancel-in-progress: true | |
steps: | |
- name: Checkout sdk automation scripts | |
uses: actions/checkout@v3 | |
with: | |
repository: moengage/sdk-automation-scripts | |
path: sdk-automation-scripts | |
ref: 'MOEN-34394_flutter_automation_scripts' | |
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }} | |
- name: Automation script setup | |
uses: ./sdk-automation-scripts/actions/flutter-repository-setup | |
- name: Checkout 🔔 | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
fetch-tags: true | |
path: source | |
token: ${{ secrets.SDK_BOT_ACCESS_TOKEN }} | |
- name: Melos Bootstrap | |
working-directory: source | |
run: melos bootstrap | |
- name: Install dependencies | |
working-directory: source | |
run: melos get | |
- name: Run Dry run | |
working-directory: source | |
run: | | |
chmod +x ./.github/scripts/dry-run.sh | |
./.github/scripts/dry-run.sh | |
- name: Validate Format | |
working-directory: source | |
run: | | |
chmod +x ./.github/scripts/verify-format.sh | |
melos exec -c 1 -- dart format . | |
./.github/scripts/verify-format.sh | |
- name: Analyze | |
working-directory: source | |
run: melos analyze | |
- name: Run tests | |
working-directory: source | |
run: melos unittest | |
# We need to build APK before running Ktlint as setting up gradle environment will be handled by flutter build apk | |
- name: Flutter build APK | |
working-directory: source | |
run: (cd example && flutter build apk --debug) | |
- name: Run Ktlint | |
working-directory: source | |
run: | | |
chmod +x ./.github/scripts/ktlint-verify.sh | |
./.github/scripts/ktlint-verify.sh |