test #60
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
# This workflow uses actions that are not certified by GitHub. | |
# They are provided by a third-party and are governed by | |
# separate terms of service, privacy policy, and support | |
# documentation. | |
name: Flutter Testを実行する | |
on: | |
push: | |
pull_request: | |
permissions: | |
contents: read | |
pull-requests: write | |
jobs: | |
get-flutter-version: | |
runs-on: ubuntu-latest | |
outputs: | |
flutter-version: ${{ steps.get-flutter-version.outputs.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get Flutter version from .fvmrc | |
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: | |
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 | |
- name: Run flutter test with coverage | |
run: flutter test --coverage --coverage-path=~/coverage/lcov.info | |
- uses: codecov/codecov-action@v4 | |
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 |