From 9ca87cafd21d4bca2dc9f978dfa592769426b77f Mon Sep 17 00:00:00 2001 From: kirznernasta Date: Wed, 24 May 2023 10:48:17 +0300 Subject: [PATCH] CI/CD: create CI/CD file for flutter analyzing and pana check --- .github/workflows/wtf_sliding_sheet.yml | 28 +++++++++++++++++++++++++ scripts/pana_check.sh | 12 +++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/wtf_sliding_sheet.yml create mode 100755 scripts/pana_check.sh diff --git a/.github/workflows/wtf_sliding_sheet.yml b/.github/workflows/wtf_sliding_sheet.yml new file mode 100644 index 0000000..b2d7413 --- /dev/null +++ b/.github/workflows/wtf_sliding_sheet.yml @@ -0,0 +1,28 @@ +name: WTF Sliding Sheet CI/CD + +on: + push: + branches: + - "master" + pull_request: + branches: + - "master" + +jobs: + analyze: + name: Analyze and pana check + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - uses: subosito/flutter-action@v2 + with: + flutter-version: '3.x' + channel: 'stable' + + - name: Analyzing + run: flutter analyze + + - name: Pana check + run: ./scripts/pana_check.sh \ No newline at end of file diff --git a/scripts/pana_check.sh b/scripts/pana_check.sh new file mode 100755 index 0000000..21e6a00 --- /dev/null +++ b/scripts/pana_check.sh @@ -0,0 +1,12 @@ +threshold=10 +dart pub global activate pana +pana --exit-code-threshold $threshold --no-warning +retVal=$? +if [ $retVal -eq 0 ] +then + echo "Good pana score" + exit 0 +else + echo "Pana score less than minimum" + exit 1 +fi \ No newline at end of file