generated from ttipo/project-base
58 lines
1.4 KiB
YAML
58 lines
1.4 KiB
YAML
name: CI (Flutter)
|
|
|
|
# Flutter 는 기본 CI 에서 분리되어 있다.
|
|
#
|
|
# 이유: SDK 다운로드로 매 실행마다 수 분이 걸리는데,
|
|
# backend/frontend 만 고친 커밋에서는 검사할 것이 없다.
|
|
#
|
|
# 언제 도는가:
|
|
# - flutter/ 아래 파일이 바뀐 푸시·PR (= 실제로 Flutter 를 쓸 때 자동으로)
|
|
# - Actions 탭의 "Run workflow" 버튼으로 수동 실행
|
|
#
|
|
# 모바일 앱을 아예 쓰지 않는 프로젝트라면 이 파일을 지우면 된다.
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
paths:
|
|
- 'flutter/**'
|
|
- '.github/workflows/ci-flutter.yml'
|
|
pull_request:
|
|
paths:
|
|
- 'flutter/**'
|
|
- '.github/workflows/ci-flutter.yml'
|
|
workflow_dispatch:
|
|
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
jobs:
|
|
flutter:
|
|
name: Flutter (analyze · test)
|
|
runs-on: ubuntu-latest
|
|
# 멈춘 잡이 러너를 무한 점유하지 않도록 상한을 둔다
|
|
timeout-minutes: 25
|
|
defaults:
|
|
run:
|
|
working-directory: flutter
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
cache: true
|
|
|
|
# .env 는 pubspec 의 asset 이라 없으면 analyze 가 경고를 낸다
|
|
- name: Prepare .env
|
|
run: cp .env.example .env
|
|
|
|
- run: flutter pub get
|
|
|
|
- name: Analyze
|
|
run: flutter analyze
|
|
|
|
- name: Test
|
|
run: flutter test
|