-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (33 loc) · 1.28 KB
/
analyze.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Sonar Flutter Example
on:
push:
branches:
- main
jobs:
analyze:
runs-on: ubuntu-latest
steps:
- name: 📚 Git Checkout
uses: actions/[email protected]
- name: Get Flutter Version From FVM config
id: get_flutter_version
run: echo "::set-output name=version::$(cat .fvm/fvm_config.json | jq -r '.flutterSdkVersion')"
- name: 🐦 Setup Flutter
uses: subosito/[email protected]
with:
flutter-version: ${{ steps.get_flutter_version.outputs.version }}
channel: stable
cache: true
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
- name: 📦 Install Dependencies
run: flutter pub get
- name: 🧪 Run Tests
run: flutter test --machine --coverage > tests.output
- name: 🪲 Run Sonar
run: |
sudo apt-get install -y openjdk-11-jdk
wget https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-6.1.0.4477-linux-x64.zip
unzip sonar-scanner-cli-6.1.0.4477-linux-x64.zip
./sonar-scanner-6.1.0.4477-linux/binsonar-scanner \
-Dsonar.token=${{secrets.SONAR_TOKEN}} \
-Dsonar.host.url=${{secrets.SONAR_HOST_URL}}