Skip to content

Create GitHub Action to validate PR #4

Create GitHub Action to validate PR

Create GitHub Action to validate PR #4

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Auto Translated Chat - PR Check
# Controls when the workflow will run
on:
pull_request:
branches:
- main
types:
- opened
- edited
- reopened
- synchronize
pull_request_target:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
validation:
name: 'Run test and build android and web code'
runs-on: ubuntu-latest
concurrency:
cancel-in-progress: true
group: ${{ github.event.pull_request.number || github.event.pull_request_target.number || github.ref }}
steps:
- name: checkout source code
uses: actions/[email protected]
with:
ref: ${{ github.event.pull_request_target.head.ref || github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request_target.head.repo.full_name || github.event.pull_request.head.repo.full_name}}
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'
- name: Flutter action
uses: subosito/[email protected]
with:
flutter-version: '3.22.0'
channel: 'stable'
- name: Flutter doctor
run: flutter doctor
- name: Format code
run: dart format . --fix --set-exit-if-changed
- name: analyse code
run: |
flutter pub get
dart run intl_utils:generate
dart analyze --fatal-infos --fatal-warnings
- name: Run tests
run: |
flutter test --coverage
- name: build apk and web
run: |
flutter build apk --debug
flutter build web
ios_validation:
name: 'iOS validation'
runs-on: macos-latest
concurrency:
cancel-in-progress: true
group: ${{ github.event.pull_request.number || github.event.pull_request_target.number || github.ref }}
needs: validation
steps:
- name: Checkout
uses: actions/[email protected]
with:
ref: ${{ github.event.sha }}
repository: ${{ github.event.pull_request_target.head.repo.full_name || github.event.pull_request.head.repo.full_name}}
fetch-depth: 0
- name: Install Flutter
uses: subosito/[email protected]
with:
flutter-version: '3.19.5'
channel: 'stable'
- name: setup XCode
uses: maxim-lobanov/[email protected]
with:
xcode-version: 15.4
- name: setup Cocoapod
uses: maxim-lobanov/[email protected]
with:
version: 1.13.0
- name: build iOS no codesign
run: |
flutter pub get
dart run intl_utils:generate
flutter build ipa --no-codesign