diff --git a/.github/workflows/code_quality.yml b/.github/workflows/code_quality.yml new file mode 100644 index 0000000..6e9ecc8 --- /dev/null +++ b/.github/workflows/code_quality.yml @@ -0,0 +1,48 @@ +# 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: Check source code quality + +on: + pull_request: + branches: ["main"] + +jobs: + lint: + name: Check lints + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + - run: flutter --version + + # Get flutter dependencies. + - name: Install dependencies + run: flutter pub get + + # Check for any formatting issues in the code. + - name: Verify formatting + run: dart format --set-exit-if-changed . + + analyze: + name: Check code analysis + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: subosito/flutter-action@v2 + with: + channel: "stable" + - run: flutter --version + + # Get flutter dependencies. + - name: Install dependencies + run: flutter pub get + + # Statically analyze the Dart code for any errors. + - name: Analyze project source + run: flutter analyze lib