From c40deae1c9404ad3aa1d2b768c07ca096259e9cb Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 10 Dec 2024 07:45:29 +0900 Subject: [PATCH 1/2] =?UTF-8?q?=E3=83=86=E3=82=B9=E3=83=88=E3=82=92?= =?UTF-8?q?=E4=B8=A6=E5=88=97=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dart_test.yml | 62 ++++++++++++++++++++++++++++----- 1 file changed, 53 insertions(+), 9 deletions(-) diff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.yml index af221756d..a03bc1afe 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -16,22 +16,69 @@ 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: + 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: ${{ env.FLUTTER_FVM_VERSION }} + flutter-version: ${{ needs.get-flutter-version.outputs.flutter-version }} cache: true - name: Run flutter version @@ -39,9 +86,6 @@ jobs: - 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 From 188a0fa2ce744d0a93b211e677d03447d7ad4dea Mon Sep 17 00:00:00 2001 From: poppingmoon <63451158+poppingmoon@users.noreply.github.com> Date: Tue, 10 Dec 2024 07:46:38 +0900 Subject: [PATCH 2/2] =?UTF-8?q?build=5Frunner=E3=82=92=E5=AE=9F=E8=A1=8C?= =?UTF-8?q?=E6=B8=88=E3=81=BF=E3=81=8B=E7=A2=BA=E8=AA=8D=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=B8=E3=83=A7=E3=83=96=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dart_test.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.github/workflows/dart_test.yml b/.github/workflows/dart_test.yml index a03bc1afe..0f345cf8c 100644 --- a/.github/workflows/dart_test.yml +++ b/.github/workflows/dart_test.yml @@ -94,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