From 0b2158e4861d315a20b4964cc3d415e9c6971c17 Mon Sep 17 00:00:00 2001 From: Amos Date: Mon, 6 May 2024 19:12:38 +0800 Subject: [PATCH] CI: Code Analysis --- .github/workflows/analysis.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/analysis.yml diff --git a/.github/workflows/analysis.yml b/.github/workflows/analysis.yml new file mode 100644 index 0000000..7e82211 --- /dev/null +++ b/.github/workflows/analysis.yml @@ -0,0 +1,35 @@ +name: 'code analysis' +run-name: 'Code Analysis' + +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - '**.md' + pull_request: + branches: + - main + paths-ignore: + - '**.md' + +jobs: + + code-analysis: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: 'stable' + - name: Prepare dependencies + run: | + flutter --version + flutter pub get + - name: Check Dart code formatting + run: | + dart format . -o none --set-exit-if-changed + - name: Analyze Dart code + run: | + flutter analyze .