Skip to content

Commit a295607

Browse files
author
Gilles Grousset
committed
feat(Actions): added Github Actions
1 parent d5f9e0b commit a295607

File tree

3 files changed

+76
-13
lines changed

3 files changed

+76
-13
lines changed

.github/workflows/analyze.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Sonar Flutter Example
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: 📚 Git Checkout
13+
uses: actions/[email protected]
14+
15+
- name: Get Flutter Version From FVM config
16+
id: get_flutter_version
17+
run: echo "::set-output name=version::$(cat .fvm/fvm_config.json | jq -r '.flutterSdkVersion')"
18+
19+
- name: 🐦 Setup Flutter
20+
uses: subosito/[email protected]
21+
with:
22+
flutter-version: ${{ steps.get_flutter_version.outputs.version }}
23+
channel: stable
24+
cache: true
25+
cache-key: flutter-:os:-:channel:-:version:-:arch:-:hash:-${{ hashFiles('**/pubspec.lock') }}
26+
27+
- name: 📦 Install Dependencies
28+
run: flutter pub get
29+
30+
- name: 🧪 Run Tests
31+
run: flutter test --machine --coverage > tests.output
32+
33+
- name: 🪲 Run Sonar
34+
uses: sonarsource/sonarqube-scan-action@master
35+
env:
36+
SONAR_TOKEN: ${{secrets.SONAR_TOKEN}}
37+
SONAR_HOST_URL: ${{secrets.SONAR_HOST_URL}}
38+

README.md

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
1-
# sonar_flutter_example
1+
# Sonar Flutter Example
22

3-
A new Flutter project.
3+
This project is a basic example of how to use the [sonar-flutter plugin](https://github.com/insideapp-oss/sonar-flutter).
44

5-
## Getting Started
5+
## Features
66

7-
This project is a starting point for a Flutter application.
8-
9-
A few resources to get you started if this is your first Flutter project:
10-
11-
- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab)
12-
- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook)
13-
14-
For help getting started with Flutter development, view the
15-
[online documentation](https://docs.flutter.dev/), which offers tutorials,
16-
samples, guidance on mobile development, and a full API reference.
7+
- Github Actions setup example

sonar-project.properties

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Project identification
2+
sonar.projectKey=sonar_flutter_example
3+
sonar.projectName=Sonar Flutter Example
4+
sonar.projectVersion=1.0
5+
6+
# Source code location.
7+
# Path is relative to the sonar-project.properties file. Defaults to .
8+
# Use commas to specify more than one file/folder.
9+
# It is good practice to add pubspec.yaml to the sources as the analyzer
10+
# may produce warnings for this file as well.
11+
sonar.sources=lib,pubspec.yaml
12+
sonar.tests=test
13+
14+
# Encoding of the source code. Default is default system encoding.
15+
sonar.sourceEncoding=UTF-8
16+
17+
# Analyzer mode
18+
# Can be:
19+
# - DETECT (attempt to detect automatically) - default
20+
# - MANUAL (an existing report needs to be provided)
21+
# - FLUTTER (flutter analyze)
22+
# - DART (dart analyze)
23+
# - DARTANALYZER (dartanalyzer)
24+
# sonar.dart.analyzer.mode=
25+
26+
# Allows reuse of an existing analyzer report when mode is MANUAL
27+
# sonar.dart.analyzer.report.path=
28+
29+
# Analyzer report output mode
30+
# Can be:
31+
# - DETECT (attempt to detect automatically, requires Dart SDK on the PATH) - default
32+
# - MACHINE (a new machine readable output that is available for Dart 2.12+)
33+
# - LEGACY (attempts to parse human readable output from dart/flutter) - default
34+
# sonar.dart.analyzer.report.mode=

0 commit comments

Comments
 (0)