Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build_runnerを実行済みか確認するジョブを追加 #706

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 74 additions & 9 deletions .github/workflows/dart_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,76 @@ permissions:
pull-requests: write

jobs:
build:
get-flutter-version:
runs-on: ubuntu-latest

outputs:
flutter-version: ${{ steps.get-flutter-version.outputs.version }}

steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1

- run: dart format --output=none --set-exit-if-changed .

- name: Get Flutter version from .fvmrc
run: echo "FLUTTER_FVM_VERSION=$(jq -r .flutter .fvmrc)" >> $GITHUB_ENV
id: get-flutter-version
run: echo "version=$(jq -r .flutter .fvmrc)" >> $GITHUB_OUTPUT

format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Install Dart
uses: dart-lang/setup-dart@v1

- name: Format
run: dart format --output=none --set-exit-if-changed .

analyze:
if: false

runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ env.FLUTTER_FVM_VERSION }}
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Run flutter version
run: flutter --version

- name: Run flutter pub get
run: flutter pub get

- name: Analyze
run: flutter analyze --fatal-infos

test:
runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Run flutter version
run: flutter --version

- name: Run flutter pub get
run: flutter pub get

# ゆくゆくは
# - run: flutter analyze --fatal-infos

- name: Run flutter test with coverage
run: flutter test --coverage --coverage-path=~/coverage/lcov.info
Expand All @@ -50,3 +94,24 @@ jobs:
with:
token: ${{secrets.CODECOV_TOKEN}}
file: ~/coverage/lcov.info

check-build-diff:
runs-on: ubuntu-latest

needs: get-flutter-version

steps:
- uses: actions/checkout@v4

- name: Install Flutter
uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }}
cache: true

- name: Run build_runner
run: dart run build_runner build -d

- name: Check diff
run: git diff --exit-code
Loading